Generating REST-API Documentation during compile with JAXRS-ANALYZER

Today I found in the OTN Java Newsletter from Oracle a hint to JAXRS-ANALYZER  from
Sebastian Daschner.

This is such an easy tool to use. Just add the build plugin into your pom and compile.


<plugin>
    <groupId>com.sebastian-daschner</groupId>
    <artifactId>jaxrs-analyzer-maven-plugin</artifactId>
    <version>0.9</version>
    <executions>
        <execution>
            <goals>
                <goal>analyze-jaxrs</goal>
            </goals>
            <configuration>
                <!-- Available backends are plaintext (default), swagger and asciidoc -->
                <backend>asciidoc</backend>
                <!-- Domain of the deployed project, defaults to example.com -->
              <deployedDomain>example.com</deployedDomain>
            </configuration>
        </execution>
   </executions>
</plugin>

The target document can be adjusted as plaintext swagger and asciidoc.

Te resulting document can be found in the target/jaxrs-analyzer folder of your maven-project.

Here is a screenshot from an asciidoc seen in AsciidocFX of a simple demo JAX-RS resource,
which I implemented to learn a little bit of wildfly-swarm.



Looks like a good starting point, since there is no Annotation or XML-Configuration or anything
else necessary in the source code, because JAXRS-Analyzer does reflection and bytecode analysis.