The JAX-RS Analyzer generates an overview of all JAX-RS resources in a JavaEE project. Besides other approaches this tool uses Bytecode analysis to maximise the extracted information.
The Analyzer is available as Maven plugin or standalone version (executable jar file).
Just add the latest release version of the JAX-RS Analyzer to your Maven 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> <backend>swagger</backend> </configuration> </execution> </executions> </plugin>
For an introductional video see JAX-RS Analyzer explained (Video).
Please see the Maven plugin project and a documentation of all parameters.
Instead of using the Maven plugin, the tool can also run directly from the jar file.
You can download the latest version here.
Alternatively the executable can be build with mvn clean install
.
Run the jar file with java -jar jaxrs-analyzer.jar [options] <projectPathToCompiledClasses> [projectPathToCompiledClasses…]
, e.g. java -jar jaxrs-analyzer.jar -b swagger ../yourProject/target/classes
.
The projectPath
entries may be directories or jar files containing the classes to be analyzed.
Following available options:
-
-b <backend>
The backend to choose:swagger
(default),plaintext
,asciidoc
-
-cp <class path>[:class paths…]
The additional class paths containing classes which are used in the project (separated by colon); this may be directories or jar-files -
-X
Debug enabled (prints error debugging information on Standard error out) -
-n <project name>
The name of the project -
-v <project version>
The version of the project -
-d <project domain>
The domain of the project -
-o <output file>
The location of the analysis output (will be printed to standard out if omitted)
Following available backend specific options (only have effect if the corresponding backend is selected):
-
--swaggerSchemes <scheme>[,schemes]
The Swagger schemes:http
(default),https
,ws
,wss
-
--renderSwaggerTags
Enables rendering of Swagger tags (default tag will be used per default) -
--swaggerTagsPathOffset <path offset>
The number at which path position the Swagger tags will be extracted (0 will be used per default)
The Analyzer supports Plaintext, AsciiDoc and Swagger as output format. The latter two can be processed further.
AsciiDoc is a human-readable, lightweight markup language and can be converted to PDF, HTML (and many more) using tools like Asciidoctor.
The Swagger JSON file can be used with Swagger UI or the Swagger Editor.
Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
For the latest changes see the Changelog.