javadoc4openapi-maven-plugin文檔工具
javadoc4openapi 使用java注釋代替swagger注解,生成openapi(swagger3)文檔,代碼零侵入.
javadoc4openapi-maven-plugin是其maven插件,項目編譯時在resources下生成javadoc4openapi.yaml文檔文件.
目前支持SpringMVC/SpringBoot
使用條件
依賴源碼,項目在編譯時需要打源碼包,Maven配置如下
<!-- Source -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
如何使用
目前還沒有上傳到Maven倉庫,需要手動在本地install一下再引用.
Maven插件配置如下
<plugin>
<groupId>org.springrain</groupId>
<artifactId>javadoc4openapi-maven-plugin</artifactId>
<version>0.0.1</version>
<configuration>
<includes>
<!--需要加載分析的maven依賴源碼包,本項目的groupId默認添加-->
<!--可以添加groupId或者groupId:artifactId-->
<!--
<include>org.springrain</include>
-->
</includes>
</configuration>
<executions>
<execution>
<!--如果不需要在執(zhí)行編譯時啟動,則將phase注釋掉-->
<phase>compile</phase>
<goals>
<goal>openapi</goal>
</goals>
</execution>
</executions>
</plugin>
評論
圖片
表情
