In addition to the maven plugin, RAML for the JAX-RS project also has a command-line interface (CLI) tool for generating RAML from the JAX-RS resources. Its usage is as follows:
- Clone the https://github.com/mulesoft-labs/raml-for-jax-rs project and build it locally.
- To generate the RAML code, run the jaxrstoraml command with the following arguments:
jaxrstoraml -a <arg> -o <arg> [-s <arg>] [-t <arg>] -a,--applicationDirectory <arg> application path -o,--output <arg> RAML output file -s,--sourceRoot <arg> JaxRs source root -t,--translatedAnnotations <arg> translated annotation list (comma separated)
From the jaxrs-to-raml-cli project folder, execute the jaxrstoraml program to generate the test.raml file, as shown ahead:
java -jar ./target/jaxrs-to-raml-cli-2.1.0-jar-with-dependencies.jar -a ../jaxrs-test-resources/target/classes -o /tmp/test.raml