2015-10-15 48 views
0

产生从JSON模式的Java类,我无法生成地址模式的任何类。我遵循了源代码中提到的同一步骤,但仍未为地址架构生成Java类。我不明白我现在能做什么。 请给我一个正确的解释。无法使用我用下面的网址来了解JsonSchema2Pojo插件的使用<a href="https://github.com/joelittlejohn/jsonschema2pojo/wiki/Getting-Started#the-maven-plugin" rel="nofollow">https://github.com/joelittlejohn/jsonschema2pojo/wiki/Getting-Started#the-maven-plugin</a></p> <p>然而JsonSchema2Pojo - Maven的插件

+0

我知道这是一个有点晚,但我可以帮助你得到工作。你能否包括你所尝试的细节? –

回答

1

仔细检查您的pom.xml和您的项目设置。在wiki上的说明工作对我来说,这里是我所采取的步骤(OSX)

  1. 生成最初的项目和pom.xml的

    mvn archetype:generate -DgroupId=com.stackoverflow.example -DartifactId=example -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false 
    
  2. 下载地址架构./src/主/资源/模式/ address.json

  3. 更新为JsonSchema2Pojo文档

  4. 生成网络上描述的pom.xml中莱

    $ 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. 生成的文件将根据./target/java-gen目录

    $ find . -name Address.java 
    ./target/java-gen/com/example/types/Address.java 
    
相关问题