Json to Yaml to Json Converter Maven Plugin

This plugin allows to convert files from json to yaml and vice versa. It makes use of the Apache Maven Filtering component therefore filtering can also be performed.

Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка
Группа

Группа

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

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

iad-j2y2j-converter-maven-plugin
Последняя версия

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

1.0
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

Json to Yaml to Json Converter Maven Plugin
This plugin allows to convert files from json to yaml and vice versa. It makes use of the Apache Maven Filtering component therefore filtering can also be performed.
Ссылка на сайт

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

https://github.com/iarellano/iad-j2y2j-converter-maven-plugin
Система контроля версий

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

https://github.com/iarellano/iad-j2y2j-converter-maven-plugin

Скачать iad-j2y2j-converter-maven-plugin

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

<plugin>
    <groupId>com.github.iarellano</groupId>
    <artifactId>iad-j2y2j-converter-maven-plugin</artifactId>
    <version>1.0</version>
</plugin>

Зависимости

compile (6)

Идентификатор библиотеки Тип Версия
com.fasterxml.jackson.dataformat : jackson-dataformat-yaml jar 2.9.8
com.fasterxml.jackson.core : jackson-databind jar 2.9.8
org.codehaus.plexus : plexus-component-annotations jar 1.7.1
org.apache.maven.shared : maven-filtering jar 3.1.1
plexus : plexus jar 0.7
avalon-framework : avalon-framework-api jar 4.3

provided (4)

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

test (3)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.apache.maven : maven-compat jar 3.3.9
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0

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

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

iad-j2y2j-converter-maven-plugin

License: MIT Maven Central

Json to Yaml to Json Converter Maven Plugin

The Json to Yaml to Json Converter Maven Plugin allows to convert files from json to yaml and vice versa. It makes use of the Apache Maven Filtering component which provides filtering functionality.

Table of contents

Goals

This plugin copies the files specified by Resource elements, to an output directory and then converts them to the specified format. Filtering is applied before files are converted. This plugin has two goals:

Getting started

You can help yourself getting started by checking the integration test in src/it and unit tests in src/test/resources/projects-to-test. Nevertheless the tables below describe the configuration parameters.

Unit testing

Two projects have been implemented for unit testing, you can run them in your system console via mvn clean test within the project root directory.

Integration testing

Another to projects have been implemented fot integraiont testing, to run them in your system console, use mvn clean verify -Prun-its

Plugin configuration

Json To Yaml Conversion Parameters

Parameter Required Type Default Description
overwrite No boolean true When true and then converted file already exists, it is overwritten, it can also be specified via system property convert.overwrite.
prettyPrintJson No boolean true When true, json is pretty printed, can also be specified via system property convert.json.pettyPrint.
indentSpaces No int 4 Specifies the number of spaces to use for indentation. prettyPrintJson has to be true to take effect, it can also be set via system property convert.json.indentSpaces.
escapeString No String \ Used to escape filtering tokens, it can also be specified via system property convert.escapeString.
outputDirectory Yes String (File path) ${project.build.directory} Directory where converted files are to be copied to, it can also be specified via system property convert.outputDirectory.
resources Yes List of Resource List of resources to include/exclude in the conversion.
encoding No String ${project.build.sourceEncoding} Specifies the resources encoding, is uses file.encoding if project.build.sourceEncoding is not set.
outputExtension No String json Specifies the extension to use in converted files, it can be specified via system property convert.json.outputExtension
escapeWindowsPaths No boolean true When true, it escapes backslashes and colons in windows-style paths, it can be specified via system property convert.escapeWindowsPaths

Yaml To Json Conversion Parameters

Parameter Required Type Default Description
overwrite No boolean true When true and then converted file already exists, it is overwritten, it can also be specified via system property convert.overwrite.
escapeString No String \ Used to escape filtering tokens, it can also be specified via system property convert.escapeString.
outputDirectory Yes String (File path) ${project.build.directory} Directory where converted files are to be copied to, it can also be specified via system property convert.outputDirectory.
resources Yes List of Resource List of resources to include/exclude in the conversion.
encoding No String ${project.build.sourceEncoding} Specifies the resources encoding, is uses file.encoding if project.build.sourceEncoding is not set.
outputExtension No String yaml Specifies the extension to use in converted files, it can be specified via system property convert.yml.outputExtension
escapeWindowsPaths No boolean true When true, it escapes backslashes and colons in windows-style paths, it can be specified via system property convert.escapeWindowsPaths

Resource Element

Resource element is better expained in Apache Maven Resources Plugin project, follow the links below for detailed information.

Examples

Json to Yaml

<plugin>
    <groupId>com.github.iarellano</groupId>
    <artifactId>iad-j2y2j-converter-maven-plugin</artifactId>
    <version>1.0</version>
    <executions>
        <execution>
            <id>json-2-yaml</id>
            <phase>process-resources</phase>
            <goals>
                <goal>json-2-yaml</goal>
            </goals>
            <configuration>
                <resources>
                    <resource>
                        <directory>${project.basedir}/src/main</directory>
                        <filtering>true</filtering>
                        <includes>
                            <include>resources/*.json</include>
                        </includes>
                    </resource>
                </resources>
                <outputExtension>yml</outputExtension>
                <outputDirectory>${project.build.directory}/resources</outputDirectory>
            </configuration>
        </execution>
    </executions>
</plugin>

Yaml to Json

<plugin>
    <groupId>com.github.iarellano</groupId>
    <artifactId>iad-j2y2j-converter-maven-plugin</artifactId>
    <version>1.0</version>
    <executions>
        <execution>
            <id>yaml-2-json</id>
            <phase>process-resources</phase>
            <goals>
                <goal>yaml-2-json</goal>
            </goals>
            <configuration>
                <resources>
                    <resource>
                        <directory>${project.basedir}/src/main</directory>
                        <filtering>true</filtering>
                        <includes>
                            <include>resources/*.yaml</include>
                        </includes>
                    </resource>
                </resources>
                <outputExtension>yml</outputExtension>
                <outputDirectory>${project.build.directory}/resources</outputDirectory>
            </configuration>
        </execution>
    </executions>
</plugin>

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

Версия
1.0