maven整合smart-doc
smart-doc对项目能够实现0代码侵入。smart-doc能够自动识别代码中标准注释参数信息。
官网地址:smart-doc官方文档
maven插件配置
<plugin>
<groupId>com.github.shalousun</groupId>
<artifactId>smart-doc-maven-plugin</artifactId>
<version>2.3.4</version>
<configuration>
<!--指定生成文档的使用的配置文件,配置文件放在自己的项目中-->
<configFile>src/main/resources/static/smart-doc.json</configFile>
</configuration>
<executions>
<execution>
<!--如果不需要在执行编译时启动smart-doc,则将phase注释掉-->
<phase>compile</phase>
<goals>
<!--smart-doc提供了html、openapi、markdown等goal,可按需配置-->
<goal>html</goal>
</goals>
</execution>
</executions>
</plugin>
smart-doc.json配置
{
"serverUrl": "http://localhost:9001", # 接口请求域名
"isStrict": false, #是否使用严格模式
"allInOne": true,#是否合并所有文档到一个文件中
"outPath": "src/main/resources/static/doc", #文档生成地址
"coverOld": true, #是否覆盖主要是md文档
"style":"xt256", # 代码高亮设置
"createDebugPage": true, #smart-doc支持创建可以测试的html页面,仅在AllInOne模式中起作用
"md5EncryptedHtmlName": false,#/只有每个controller生成一个html文件是才使用
"projectName": "**系统"
}
版权声明:本文为Luohanghong原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。