找不到@EnableSwagger注释

问题描述 投票:4回答:3

我只想记录我的春季休息应用程序。关于如何使用springfox,我在pom.xml中添加了依赖项:

<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>2.7.0</version>
</dependency>

jar正确下载但我无法找到@ EnableSwagger2注释。

java spring maven spring-boot swagger
3个回答
3
投票

同样在这里。 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。


0
投票

它应该在qazxsw poi包中。


-1
投票

我使用swagger 2.8.0,@ EnableSwagger2无法解析,然后,我del del本地maven存储库,然后重新导入它,没关系!

© www.soinside.com 2019 - 2024. All rights reserved.