Offline swagger documentation using maven plugin

6.3k Views Asked by At

I am trying to generate swagger documentation, for that I need to start the server. I Want to generate swagger documentation offline (with out starting the server), I just got this link swagger-codegen-maven-plugin

But when I added above plugin to POM.xml (Suppose to generate HTML doc during maven build i feel), it is not at all doing anything. Please help.

2

There are 2 best solutions below

0
On

Take a look at this plugin: https://github.com/teamcarma/swagger-jaxrs-doclet

As the JSON resource listing is generated offline from source code it means that you do not need to add any runtime dependencies to your project and avoid potential headaches with different jar versions and jaxrs implementations. This also avoids increasing the size of your artifacts

0
On

To generate the HTML documentation, you need to set the value of the language tag in the configuration to HTML. In the example from your link, it is set to java. Change it to html. If you need both Java and HTML to be generated, have two execution blocks, one for Java, one for HTML.