JAX-RS: Get swagger.json For Free!

JAX-RS analyzer maven plugin examines JAX-RS resources in your Java EE project and generates the swagger.json definition. There are no runtime dependencies, additional annotations or configuration required, you only have to include the plugin to your maven build and then mvn clean install your project:

				<!-- Available backends, defaults to plaintext -->
				<!-- <backend>plaintext</backend> -->

The recent release (swaggerina) of headlands ships with swagger-ui with the spec generated by the JAX-RS analyzer plugin. A drop-in WAR is also available.

Big thanks to Sebastian Daschner, an airhacks alumni, for this time-saver. I think you should star the repo: https://github.com/sdaschner/jaxrs-analyzer :-).

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting

NEW online workshop: Web Components training (online)

Airport MUC workshops: Java EE 8, Java 9: Bootstrap, Effective, Architectures, Single Page Apps, Progressive Web Apps, HTML 5, ES 6, CSS 3 and Microservices

Podcast: airhacks.fm and newsletter: airhacks.news

A book about rethinking Java EE Patterns


Does SWAGGER works with subresource locator ? I tested an old version and this doesn't work ! Thank's

Posted by Yahiaoui on May 11, 2015 at 12:05 PM CEST #

But what is 'Swagger'?

Posted by javaservant on May 11, 2015 at 02:23 PM CEST #

Thanks for the great information and tip. This will make the process of documenting JAX-RS so much easier.

Posted by John Yeary on May 12, 2015 at 01:54 PM CEST #

Hi Adam, this is really great and very important for restful apis. I am also using a maven plugin which scans JaxRS annotations and generated json file describing the API in swagger spec format:


The interesting here is that you can enhance your API with javadoc tags (instead of using Swagger annotations).

I've also blogged about it here: https://rpestano.wordpress.com/2014/12/21/some-words-on-javaee-rest-and-swagger/

Posted by rmpestano on May 14, 2015 at 01:21 PM CEST #

Does JAX-RS Analyzer Maven plugin need a Java SE greater than 1.7?
Our CM is saying that JAX-RS Analyzer does not run with JAVA SE 1.7.


Posted by BN on March 14, 2016 at 07:59 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
Online Workshops
...the last 150 posts
...the last 10 comments