com.github.zou8944:json-loader-maven-plugin

A Maven Plugin to load json file from project path to Maven properties

License

License

Categories

Categories

Maven Build Tools JSON Data
GroupId

GroupId

com.github.zou8944
ArtifactId

ArtifactId

json-loader-maven-plugin
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

com.github.zou8944:json-loader-maven-plugin
A Maven Plugin to load json file from project path to Maven properties
Project URL

Project URL

https://github.com/zou8944/json-loader-maven-plugin
Source Code Management

Source Code Management

https://github.com/zou8944/json-loader-maven-plugin

Download json-loader-maven-plugin

How to add to project

<plugin>
    <groupId>com.github.zou8944</groupId>
    <artifactId>json-loader-maven-plugin</artifactId>
    <version>1.0.0</version>
</plugin>

Dependencies

compile (4)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.6.2
org.apache.maven : maven-project jar 2.2.1
org.apache.maven : maven-artifact jar 2.2.1
com.alibaba : fastjson jar 1.2.61

provided (1)

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

test (1)

Group / Artifact Type Version
junit : junit jar 4.13

Project Modules

There are no modules declared in this project.

Maven Central

json-loader-maven-plugin

将Json文件加载到Maven工程的properties

参考properties-maven-plugin

Load json file to maven project

Usage

<project>
  ...
  <build>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>com.github.zou8944</groupId>
        <artifactId>json-loader-maven-plugin</artifactId>
        <version>1.0.0</version>
        <executions>
          <execution>
            <phase>initialize</phase>
            <goals>
              <goal>read-project-json-to-properties</goal>
            </goals>
            <configuration>
              <files>
                <file><!--your file location--></file>
              </files>
            </configuration>
          </execution>
        </executions>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

Example

json-loader-maven-plugin loads the following json file and properties-maven-plugin loads the following properties file with the same result

{
    "video": {
        "db": {
            "ergedd": {
                "host": "111.111.111.111",
                "port": 1234,
                "username": "username",
                "password": "password",
                "database": "database"
            }
        }
    }
}
video.db.ergedd.host=111.111.111.111
video.db.ergedd.port=1234
video.db.ergedd.username=username
video.db.ergedd.password=password
video.db.ergedd.database=database

Related

Versions

Version
1.0.0