How to generate pojo from json schema by maven
来源:互联网 发布:软件销售方案 编辑:程序博客网 时间:2024/05/29 02:46
Generate json schema from json
you can generate json schema online through the following website.
http://jsonschema.net/
Generate pojo by maven
Add the following maven configuration to your pom.xml, and execute maven command. you will find pojo generated by maven in your project.
<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <maven.compiler.encoding>UTF-8</maven.compiler.encoding></properties><dependencies> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.0.0</version> </dependency></dependencies><build> <testSourceDirectory>src/test/java</testSourceDirectory> <defaultGoal>install</defaultGoal> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.jsonschema2pojo</groupId> <artifactId>jsonschema2pojo-maven-plugin</artifactId> <version>0.4.20</version> <configuration> <sourceDirectory>${basedir}/src/main/resources/schema</sourceDirectory> <targetPackage>com.example.types</targetPackage> </configuration> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> </plugin> </plugins></build>
Note: you need put your json schema in path ${basedir}/src/main/resources/schema.
you can visit website https://github.com/joelittlejohn/jsonschema2pojo for more information.
0 0
- How to generate pojo from json schema by maven
- How to Generate Hibernate Pojo Classes from DB Tables
- How to generate EOF from keyboard
- How to generate dot file from IDA's GDL format
- How to: Generate XML file from database table
- How to generate UML Diagrams from Java code in Eclipse
- How to generate a local image from openstack
- how to generate pb file from ckpt files?
- How to generate DLL files by GCC in the MinGW?
- How to generate high quality image by using Imagemagick
- How to export class from xml schema file
- How to create XML validator from XML schema?
- How to remove k__BackingField from Json data
- how to explain POJO
- How to generate certificate
- How to convert Java object to / from JSON (Gson)
- How to convert Java object to / from JSON (Gson)
- How to prevent from writing into USB drive by GPO
- struts框架中,filter和interceptors区别?
- HTML标签的分类
- 测试不同格式下depth buffer的精度
- 相对路径和绝对路径
- 安装rrdtool和cacti遇到的问题
- How to generate pojo from json schema by maven
- 面向对象设计使用语言选择
- 关键字volatile的使用
- mamp pro破解方法
- 延迟加载三种方式
- 安装VMware tools,实现windows和虚拟机之间文件拷贝
- 欢迎使用CSDN-markdown编辑器
- jquery教程
- linux常用操作