Spring Boot + Springbox swagger error(Spring Boot + Springbox 招摇错误)
问题描述
我有一个spring boot项目想通过springbox与swagger集成.
I have a spring boot project want to integrate with swagger via springbox.
我的 Spring Boot 应用程序启动并运行良好.
I have my spring boot app up and running all good.
但是我添加了springbox后,它无法通过单元测试.
However after I added springbox, it can not pass unit test.
这是我在项目中添加的详细信息.
Here are the details I added in project.
对于pom.xml
,添加
然后用一个大摇大摆的配置类
then with a swagger config class
我在运行 mvn clean package
时遇到的错误是
The error I am getting when run mvn clean package
is
我使用的版本是
推荐答案
一直在研究这个问题有一段时间没有运气,然后发布了这个问题.刚刚发布问题后,我找到了解决方案......(我责怪早上咖啡不太好)
Been looking into this problem for the while morning without luck, then posted this question. Just after posted the question, I found out the solution for this..... (I blame on the not-so-good morning coffee)
只需去掉swagger配置类中的@Configuration
注解即可.
Simply remove the @Configuration
annotation in the swagger configuration class.
这是我参考的链接
https://github.com/springfox/springfox/issues/462
这篇关于Spring Boot + Springbox 招摇错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!