Maven plugin for using json-schema-validator
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Build Status

JSON Schema Validator Maven Plugin

An Apache Maven (3.2.1+) plugin that validates a set of JSON files in the project against JSON schema.

Use Cases

Validating your JSON against a schema can help finding issues early, and possibly prevent regressions. There are two main use cases for doing that validation inside your build:

  1. Validate test data against existing schemas
  2. Validate schemas themselves against the JSON Schema schema


The plugin is available in Maven Central, so you should be able to just add



There is only one available goal, validate. validate processes the included files in the given sourceDirectory.


Setting Default Value Description
sourceDirectory (required) The directory to scan for JSON files to process
includes *.json A list of include patterns to process
requireSchema false If true then files without a $schema reference will lead to validation failures, otherwise those files are ignored
deepCheck true If false then validation stops early, if true children are validated even if the container (array, object) is invalid
schemaMappings (none) Definitions for mapping directories to URIs, see below

schemaMappings can be used to map directories on the file system to URIs, for example the following mapping will tell the validator that schemas for are available in the directory src/main/schema/:


With this definition a schema definitions/TYPE inside the file src/main/schema/data.json can be referenced in other files using { "$schema": "" }


Copyright 2015 Collaborne B.V.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.