1

I have used the following URL to understand the usage of JsonSchema2Pojo plugin https://github.com/joelittlejohn/jsonschema2pojo/wiki/Getting-Started#the-maven-plugin

However, I am unable to generate any class for the address schema. I have followed the same step as mentioned in the source but still no java class has been generated for address schema. I don't understand what can I do now. Please help me with a proper explanation.

chetan sharma
  • 121
  • 2
  • 8

1 Answers1

1

Double check your pom.xml and your project setup. The instructions on the wiki worked for me, here are the steps I took (OSX)

  1. Generate the initial project and pom.xml

    mvn archetype:generate -DgroupId=com.stackoverflow.example -DartifactId=example -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
    
  2. Download the address schema to ./src/main/resources/schema/address.json

  3. Update the pom.xml as described on the JsonSchema2Pojo documentation

  4. Generate the files

    $ find . -type f
    ./pom.xml
    ./src/main/java/com/stackoverflow/example/App.java
    ./src/main/resources/schema/address.json
    ./src/test/java/com/stackoverflow/example/AppTest.java
    $ mvn package
    
  5. Generated files will be under ./target/java-gen directory

    $ find . -name Address.java
    ./target/java-gen/com/example/types/Address.java
    
ayvazj
  • 3,943
  • 1
  • 14
  • 14