This is useful when you want to distribute your documentation to people that do not have access to the server hosting your API (and your JSONDoc endpoint). You will need to use the jsondoc-maven-plugin and then play a bit with other maven plugins. Let's see how this can be done:
Declare the jsondoc-maven-plugin
Unpack the jsondoc-ui dependency
Repackage into a distributable zip
This is the assembly descriptor to be used:
Note the presence of the filtered tag. This means that everything in the specified directory will be filtered with properties defined in the pom file. For example, to correctly display a value in the input box at the top of the JSONDoc UI, you may want to filter the ${jsondoc.path} placeholder (in jsondoc-ui.html) with the filename generated by the jsondoc-maven-plugin. Here is a part of the pom file showing the properties section for both an online generation of the documentation and a distributable one:
Browsing the documentation using a webserver
The result of the mvn clean package -Pdistributable command will be a zip containing the UI and the documentation json. Note that you still need to run a server to browse the documentation, but this is very simple:
Unzip the package in a directory of your choiche
Move to that directory and in a terminal just type python -m SimpleHTTPServer
Open the browser and browse the documentation at http://localhost:8000/jsondoc-ui.html
Browsing the documentation without using a webserver
If you want the documentation to be totally browsable offline and without a server hosting the ui page, then there is another step to be done, i.e. adding another maven plugin to the flow described previously.
And then run the mvn clean package -Pdistributable command again. In the packaged zip you will now find the resulting documentation, browsable offline. Just open the jsondoc-ui.html page and the documentation will be displayed in your browser.
Example pom for offline bundle generation
Here is the resulting piece of the pom file to correctly bundle the documentation in an offline package: