How to compile JSON Schema Validator JAR with all dependencies
Posted on June 8th, 2012
I’ve recently faced with issue where I should validate JSON schemas from Java. I found project http://json-schema.org/ which has implementation for Java https://github.com/fge/json-schema-validator
But there was a promlem to compile this project with all dependencies, because of all maven targets compiled JAR without dependencies.
To solve this issue:
- Clone code from git
- Using Idea “Create new project from existing sources"
- Go to “Run Configurations" and create “Maven Run Configuration" with command line parameter assembly:single
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<artifactId>maven-assembly-plugin</artifactId> | |
<configuration> | |
<descriptorRefs> | |
<descriptorRef>jar-with-dependencies</descriptorRef> | |
</descriptorRefs> | |
</configuration> | |
</plugin> |
- Go to pom.xml file and add assembly plugin
- Run with “Maven Run Configuration" and you will get generated JAR with all dependencies in target folder of your project!