解决maven引入swagger2markup 包报错问题

问题截图

image-20201104171201288

在pom.xml中配置repositories

<repositories>
    <repository>
        <id>spring-libs-milestone</id>
        <url>https://repo.spring.io/libs-milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>spring-plugins-release</id>
        <url>https://repo.spring.io/plugins-release</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>

问题解决,不再报错

image-20201104171409701

参考链接

https://github.com/Swagger2Markup/swagger2markup/issues/300

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
Swagger2Markup是一个用于将Swagger API文档转换为Markdown或AsciiDoc格式的工具。它可以帮助开发人员将Swagger API文档转换为可读性更好的格式,以便于文档的编写、分享和维护。 使用Swagger2Markup可以按照以下步骤进行: 1. 添加Swagger2Markup依赖:在项目的构建文件中添加Swagger2Markup的依赖,例如在Maven项目中可以在pom.xml文件中添加以下依赖: ```xml <dependency> <groupId>io.github.swagger2markup</groupId> <artifactId>swagger2markup</artifactId> <version>1.3.3</version> </dependency> ``` 2. 配置Swagger API文档:在项目中配置Swagger API文档的地址和相关信息,例如在Spring Boot项目中可以通过在application.properties或application.yml文件中添加以下配置: ```yaml springfox.documentation.swagger.v2.path=/v2/api-docs ``` 3. 生成Markdown或AsciiDoc文档:使用Swagger2Markup提供的API将Swagger API文档转换为Markdown或AsciiDoc格式的文档。可以通过编写一个Java类来实现这一步骤,例如: ```java import io.github.swagger2markup.Swagger2MarkupConverter; import java.nio.file.Paths; public class SwaggerToMarkup { public static void main(String[] args) throws Exception { Swagger2MarkupConverter.from(Paths.get("swagger.json")) .build() .toFile(Paths.get("output")); } } ``` 其中,`swagger.json`是Swagger API文档的地址,`output`是生成的Markdown或AsciiDoc文档的输出路径。 4. 生成文档:运行上述Java类,即可生成Markdown或AsciiDoc格式的文档。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值