Generates an overview of all JAX-RS resources in a project by bytecode analysis.
Yet another such JAX-RS tool?
Yes, but this gathers the information about the JAX-RS resource classes by bytecode analysis (not just by reflection).
This gains more information in several situations. You don’t need additional annotations on your JAX-RS resource methods.
Using the JSR 339 standard is sufficient.
Java 8 is needed for the Analyzer.
The Analyzer can be added to your project via Maven plugin.
One of the output formats of the REST documentation is the heavily used Swagger API format. The tool creates the JSON file which can be loaded with Swagger UI.
Instead of using the Maven plugin, the tool can also run directly from the jar file. Therefore this project needs to be build with mvn clean install
.
The executable jar file resides under target/jaxrs-analyzer.jar
.
Run it 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) -
-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)
Feedback, bug reports and ideas for improvement are very welcome! Feel free to fork, comment, file an issue, etc. ;-)
For a current feature list see Feature list of JAX-RS Analyzer (v0.2), Released JAX-RS Analyzer v0.3, Released JAX-RS Analyzer v0.4 and Released JAX-RS Analyzer v0.5.
For an introductional video see JAX-RS Analyzer explained (Video).