

The Maven plugin provides a generate goal that attaches to the generate-sources phase by default.įor a quick example, place the address schema into src/main/resources/schema and edit your pom.xml to include the following in the section:
#JSON CLASS GENERATOR JAVA CODE#
directly from your code (embedded) using jsonschema2pojo-core.as a gradle plugin using gradle-jsonschema2pojo-plugin.as an ant task using jsonschema2pojo-ant.via the command line using jsonschema2pojo-cli.as a maven plugin using jsonschema2pojo-maven-plugin.

After satisfaction of the preview, you can go ahead and download the POJO for use in your projects. Once you are done with the settings click on the Preview button to have a look at how your POJO will look like. Copy/Paste your valid JSON-Schema in the box provided and change the settings as per your requirements.

In case you have missed that journal then we would suggest you to have a look at “Easy way to convert JSON to Java POJO”. One of our previous journals showcases how you can easily convert JSON data to Java POJO.
