Json Schema Validator Maven Plugin

Maven plugin to validate json files against a json schema

License

License

Categories

Categories

Maven Build Tools JSON Data
GroupId

GroupId

com.groupon.maven.plugin.json
ArtifactId

ArtifactId

json-schema-validator
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Json Schema Validator Maven Plugin
Maven plugin to validate json files against a json schema
Project URL

Project URL

https://github.com/groupon/json-schema-validator
Source Code Management

Source Code Management

https://github.com/groupon/json-schema-validator

Download json-schema-validator

How to add to project

<plugin>
    <groupId>com.groupon.maven.plugin.json</groupId>
    <artifactId>json-schema-validator</artifactId>
    <version>1.2.0</version>
</plugin>

Dependencies

compile (6)

Group / Artifact Type Version
com.github.fge : json-schema-validator jar 2.2.6
com.fasterxml.jackson.core : jackson-core jar 2.6.2
org.apache.maven.plugin-tools : maven-plugin-tools-api jar 3.2
org.codehaus.plexus : plexus-component-annotations jar 1.5.5
org.codehaus.plexus : plexus-resources jar 1.0-alpha-7
com.google.code.findbugs : annotations jar 3.0.0

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-tools-annotations jar 3.2

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-core jar 1.10.19
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 1.2

Project Modules

There are no modules declared in this project.

json-schema-validator

License: Apache 2 Travis Build Maven Artifact

Maven plugin to validate json files against a json schema. Uses https://github.com/fge/json-schema-validator library under the covers.

Usage

Determine the latest version of the validator in Maven Central.

Add the plugin to your pom either in the plugins or pluginManagement block:

<plugin>
    <groupId>com.groupon.maven.plugin.json</groupId>
    <artifactId>json-schema-validator</artifactId>
    <version>VERSION</version>
</plugin>

Configure one or more validation blocks for the plugin in the plugins block:

<plugin>
    <artifactId>json-schema-validator</artifactId>
    <groupId>com.groupon.maven.plugin.json</groupId>
    <executions>
        <execution>
            <phase>verify</phase>
            <goals>
                <goal>validate</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <validations>
            <validation>
                <directory>${basedir}/src/main/resources/data</directory>
                <jsonSchema>${basedir}/src/test/resources/data.schema</jsonSchema>
                <includes>
                    <include>**/*.json</include>
                </includes>
            </validation>
        </validations>
    </configuration>
</plugin>

Each validation block specifies the jsonSchema file to validate with as well as the json file(s) to validate from a root directory with standard includes and excludes to select specific file(s).

Building

Prerequisites:

Building:

json-schema-validator> mvn verify

To use the local version you must first install it locally:

json-schema-validator> mvn install

You can determine the version of the local build from the pom file. Using the local version is intended only for testing or development.

License

Published under Apache Software License 2.0, see LICENSE

© Groupon Inc., 2014

com.groupon.maven.plugin.json

Groupon

Versions

Version
1.2.0