yaml-json-validator-maven-plugin Maven Plugin

A Maven Plugin to validate yaml and json document

Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка JSON Данные
Группа

Группа

com.github.sylvainlaurent.maven
Идентификатор

Идентификатор

yaml-json-validator-maven-plugin
Последняя версия

Последняя версия

1.0.4
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

yaml-json-validator-maven-plugin Maven Plugin
A Maven Plugin to validate yaml and json document
Ссылка на сайт

Ссылка на сайт

https://github.com/sylvainlaurent/yaml-json-validator-maven-plugin
Система контроля версий

Система контроля версий

https://github.com/sylvainlaurent/yaml-json-validator-maven-plugin

Скачать yaml-json-validator-maven-plugin

Как подключить последнюю версию

<plugin>
    <groupId>com.github.sylvainlaurent.maven</groupId>
    <artifactId>yaml-json-validator-maven-plugin</artifactId>
    <version>1.0.4</version>
</plugin>

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-plugin-api jar 3.0
org.apache.maven : maven-project jar 2.2.1
org.codehaus.plexus : plexus-utils jar 3.2.0
com.fasterxml.jackson.dataformat : jackson-dataformat-yaml jar 2.8.11
com.github.java-json-tools : json-schema-validator jar 2.2.10

provided (1)

Идентификатор библиотеки Тип Версия
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.slf4j : slf4j-simple jar 1.6.3

Модули Проекта

Данный проект не имеет модулей.

yaml-json-validator-maven-plugin

Build Status

This maven plugin allows to validate yaml and json files to check that they are well formed and optionally validate against JSON schemas.

Both JSON and YAML files can be validated against a JSON schema. The library fge/json-schema-validator is internally used for this.

Plugin configuration

      <plugin>
        <groupId>com.github.sylvainlaurent.maven</groupId>
        <artifactId>yaml-json-validator-maven-plugin</artifactId>
        <version>...</version>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>validate</goal>
            </goals>
            <configuration>
              <validationSets>
                <validationSet>
                  <jsonSchema>src/main/resources/my-schema.json</jsonSchema>
                  <includes>
                    <include>src/main/resources/*.json</include>
                  </includes>
                  <excludes>
                    <exclude>src/main/resources/do-not-validate*.json</exclude>
                    <!-- <exclude> is optional, others may be added -->
                  </excludes>
                </validationSet>
                <validationSet>
                  <!-- no jsonSchema is specified, check only that file are well formed -->
                  <includes>
                    <include>src/main/resources/*.yml</include>
                  </includes>
                </validationSet>
              </validationSets>
              <!-- Duplicate keys detection is turned on by default. -->
              <detectDuplicateKeys>false</detectDuplicateKeys>
              <allowEmptyFiles>false</allowEmptyFiles>
              <!-- Allow comments in json files is turned off by default -->
              <allowJsonComments>true</allowJsonComments>
              <!-- Trailing commas are not allwed by default -->
              <allowTrailingComma>true</allowTrailingComma>
              <skip>false</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>

Validation failures make the build fail.

Requires java 1.7.

Версии библиотеки

Версия
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0