我只想记录我的春季休息应用程序。关于如何使用springfox,我在pom.xml中添加了依赖项:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
jar正确下载但我无法找到@ EnableSwagger2注释。
同样在这里。 springfox-core中不存在springfox.documentation.swagger2 jar:2.7.0当我以前使用它时,它们存在于2.6.1的早期版本中。我回到了2.6.1。
检查他们的2.7.0发行说明以查看是否存在您需要的任何错误修复可能不是一个坏主意:https://github.com/springfox/springfox/releases/tag/2.7.0
更新:@EnableSwagger实际上是在springfox-swagger2-2.7.0.jar而不是springfox-core.jar。
它应该在qazxsw poi包中。
我使用swagger 2.8.0,@ EnableSwagger2无法解析,然后,我del del本地maven存储库,然后重新导入它,没关系!