SpringのRequestMappingの一覧をmavenで出力する。
こんな感じ。
ただし、Controllerのみで、RestControllerについては出力されません。
SpringDocletというのがあって
https://github.com/scottfrederick/springdoclet
それを、 [twitter:@yujiorama]さんが更新したものを使います。
https://bitbucket.org/yujiorama/springdoclet
ダウンロードから丸々取ってくると、zipがおちてくるので、トップディレクトリで
を実行します。
mvn package install site
するとsample/target/site/apidocs/spring-summary.htmlにサンプルの実行結果が出力されます。
自分のアプリで実行したい場合はpom.xmlに以下のような感じで記載。sampleに入っているものからversion番号だけ適切にしています。
spring-bootでない場合は${maven.jxr.version}も適切に設定する必要があります。
<build> <plugins> <!-- This plugin section was added for the SpringDoclet project as an example of using the doclet from Maven. --> <!-- run "mvn javadoc:javadoc" to use this plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <executions> <execution> <id>before-tests-spring-javadoc</id> <phase>generate-test-resources</phase> <goals> <goal>javadoc</goal> </goals> <configuration> <doclet>org.springdoclet.SpringDoclet</doclet> <docletArtifact> <groupId>org.springdoclet</groupId> <artifactId>springdoclet</artifactId> <version>0.5-SNAPSHOT</version> </docletArtifact> <useStandardDocletOptions>false</useStandardDocletOptions> </configuration> </execution> <execution> <id>before-tests-javadoc</id> <phase>generate-test-resources</phase> <goals> <goal>javadoc</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <reporting> <plugins> <!-- This plugin section was added for the SpringDoclet project as an example of using the doclet from Maven. --> <!-- This configuration generates the springdoclet output along with the standard doclet output. --> <!-- run "mvn site" to use this plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> <version>${maven.jxr.version}</version> </plugin> </plugins> </reporting>
という感じで。