请问下swagger有4.0以上的版本吗,我在中央仓库只找到3.0的版本,但是项目安全扫描需要4.0以上的,直接用maven去下
下不到4.0以上的版本
这个我记得当时也是很难下载的,需要找一下多方面找一下不同的下载源
代码
<!-- Swagger2引入 开始-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.6.1</version>
</dependency>
<!-- 额外导入 对应网址是原先swagger-ui.html 修改成doc.html -->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-bean-validators</artifactId>
<version>2.9.2</version>
</dependency>
<!-- Swagger2引入 结束-->
目前 版本有2.9.2 测试中2.6.1也可以使用
对于Swagger 4.0以上的版本,你可以通过以下步骤使用Maven来下载:
首先,打开你的项目的pom.xml文件。
在dependencies标签内添加以下两个依赖:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>4.0.0</version>
</dependency>
这些依赖将会下载Swagger 4.0以上的版本和Swagger官方UI。
mvn clean install
这将会从Maven中央仓库下载Swagger 4.0以上的版本。
完成以上步骤后,你的项目将会成功下载Swagger 4.0以上的版本。你可以在你的项目中使用这个版本进行安全扫描。
如果你发现Swagger仍然没有更新到4.0以上的版本,那可能是因为Swagger最新版本的发布稍晚于你查询的时间点。在这种情况下,你可以尝试等待一段时间,然后再次运行Maven命令来更新你的项目依赖。
如果以上解决方案不能解决你的问题,你可以尝试检查其他Maven仓库或者直接从Swagger官方网站下载最新版本的Swagger并手动导入到你的项目中。