Spring Boot smart-doc-maven-plugin导出接口文档

pom.xml

            <plugin>
                <groupId>com.github.shalousun</groupId>
                <artifactId>smart-doc-maven-plugin</artifactId>
                <version>2.6.4</version>
                <configuration>
                    <configFile>./src/main/resources/smart-doc.json</configFile>
                    <projectName>${project.description}</projectName>
                    <includes>
                        <!-- Page paging using mybatis-plus requires the source code package used by include -->
                        <include>com.baomidou:mybatis-plus-extension</include>
                        <!-- IPage paging using mybatis-plus needs to include mybatis-plus-core-->
                        <include>com.baomidou:mybatis-plus-core</include>
                        <!-- Paging using jpa requires the source code package used by include -->
                        <include>org.springframework.data:spring-data-commons</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <!--If you do not need to start smart-doc when compiling, comment out phase-->
                        <phase>compile</phase>
                        <goals>
                            <!--smart-doc provides html, openapi, markdown and other goals, which can be configured as needed-->
                            <goal>html</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

./src/main/resources/smart-doc.json

{
  "outPath": "D://md2" //Specify the output path of the document
}

how to use

  1. Directly use the smart-doc module in the Maven plug-in directory in IDEA

  2. Execute in command line

mvn -Dfile.encoding=UTF-8 smart-doc:html
mvn -Dfile.encoding=UTF-8 smart-doc:markdown
mvn -Dfile.encoding=UTF-8 smart-doc:torna-rest
...
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • """1.个性化消息: 将用户的姓名存到一个变量中,并向该用户显示一条消息。显示的消息应非常简单,如“Hello ...
    她即我命阅读 8,538评论 0 5
  • 为了让我有一个更快速、更精彩、更辉煌的成长,我将开始这段刻骨铭心的自我蜕变之旅!从今天开始,我将每天坚持阅...
    李薇帆阅读 5,987评论 0 3
  • 似乎最近一直都在路上,每次出来走的时候感受都会很不一样。 1、感恩一直遇到好心人,很幸运。在路上总是...
    时间里的花Lily阅读 5,231评论 0 2
  • 1、expected an indented block 冒号后面是要写上一定的内容的(新手容易遗忘这一点); 缩...
    庵下桃花仙阅读 3,567评论 0 1
  • 一、工具箱(多种工具共用一个快捷键的可同时按【Shift】加此快捷键选取)矩形、椭圆选框工具 【M】移动工具 【V...
    墨雅丫阅读 3,558评论 0 0