smart-doc和springboot集合生成API文档
一:pom.xml文件添加插件
<plugin> <groupId>com.github.shalousun</groupId> <artifactId>smart-doc-maven-plugin</artifactId> <version>2.2.6</version> <configuration> <!--指定生成文档使用的配置文件--> <configFile>./src/main/resources/smart-doc.json</configFile> </configuration> <executions> <execution> <!--不需要在编译项目时自动生成文档可注释phase--> <!--<phase>compile</phase>--> <goals> <goal>html</goal> </goals> </execution> </executions> </plugin>
二:根据<configFile>配置添加smart-doc.json文件,简单内容如下
{ "isStrict": false, "allInOne": true, "outPath": "src/main/resources/static/doc", "projectName": "hzz_springb" }
三:按照Java doc标准格式注释就可以自动识别参数
四:利用maven 运行 插件smart-doc生成你想要的格式
五:生成的index.html文件在src/main/resources/static/doc下
在浏览器打开即可(可以生成多种格式文件,根据自己需要选择)