Smart-doc优点:
1.非侵入式生成接口文档
2.减少接口文档的手动更新麻烦&保证了接口文档和代码的一致
3.随时可生成最新的接口文档
4.保持团队代码风格一致:smart-doc支持javadoc,必须按照这个才能生成有注释的接口文档
最终效果
1.导入依赖
<plugin><groupId>com.github.shalousun</groupId><artifactId>smart-doc-maven-plugin</artifactId><version>2.2.7</version><configuration><configFile>./src/main/resources/smart-doc.json</configFile><projectName>Smart-Doc初体验</projectName></configuration></plugin>
2.在resources下新建smart-doc.json
{"serverUrl": "http://127.0.0.1:8081","packageFilters": "com.demo.controller.DemoController","isStrict": false,"allInOne": true,"outPath": "src/main/resources/static/doc","projectName": "smart-doc"
}
3.复制到smart-doc.json
4.直接打开index.html
http://localhost:63342/demo/static/doc/index.html?_ijt=9d6ajticc8vm2ckffmddok81hj