Permalink
bd3bc0a Feb 16, 2018
@sdaschner @coding-guy
63 lines (50 sloc) 3.03 KB

JAX-RS Analyzer Maven Plugin

The JAX-RS Analyzer Maven plugin activates the JAX-RS Analyzer for Maven builds.

To enable the plugin, simply add these lines to your pom.xml in the <plugins> section.

<plugin>
    <groupId>com.sebastian-daschner</groupId>
    <artifactId>jaxrs-analyzer-maven-plugin</artifactId>
    <version>0.14</version>
    <executions>
        <execution>
            <goals>
                <goal>analyze-jaxrs</goal>
            </goals>
            <configuration>
                <!-- Available backends are plaintext (default), swagger, asciidoc and markdown -->
                <backend>plaintext</backend>
                <ignoredBoundaryClasses>com.domain.foo.boundary.internal.Employees,com.domain.foo.boundary.internal.Salary</ignoredBoundaryClasses>
                <!-- Domain of the deployed project, defaults to "" -->
                <deployedDomain>example.com</deployedDomain>
                <!-- Comma separated list of Swagger schemes (only for if backend is swagger, defaults to http) -->
                <swaggerSchemes>https,http</swaggerSchemes>
                <!-- Enables rendering of Swagger tags (defaults to false -> default tag will be used) -->
                <renderSwaggerTags>true</renderSwaggerTags>
                <!-- The number at which path position the Swagger tags will be extracted (defaults to 0) -->
                <swaggerTagsPathOffset>1</swaggerTagsPathOffset>
                <!-- Directory (relative to buildDir) where resources will be generated (defaults to jaxrs-analyzer) -->
                <resourcesDir>jaxrs-analyzer</resourcesDir>
            </configuration>
        </execution>
    </executions>
</plugin>

After building your project, the documentation resides under 'target/jaxrs-analyzer/'.

Configuration

Backend

The backend parameter specifies the output format of the analysis. The available formats are Plaintext, AsciiDoc, Markdown and Swagger.

For further use of the created formats see the JAX-RS Analyzer documentation.

Ignored boundary classes

The ignoredBoundaryClasses parameter is used to specifies a blacklist of classes. Here you can specify your boundary classes which are present at the API but should not be documented anyway.

Deployed domain

With deployedDomain the user may specify the URL which will contain the REST API later on. Tools like Swagger make use of this information (and offer possibilities to send calls directly, etc.).

Swagger options

  • swaggerSchemes The comma separated list of Swagger schemes: http (default), https, ws, wss

  • renderSwaggerTags Enables rendering of Swagger tags (defaults to false, then the default tag will be used)

  • swaggerTagsPathOffset The number at which path position the Swagger tags will be extracted (defaults to 0)

Contributing

Feedback, bug reports and ideas for improvement are very welcome! Feel free to fork, comment, file an issue, etc. ;-)