1.6.1 • Published 3 years ago

sync-pom-version-to-package v1.6.1

Weekly downloads
512
License
MIT
Repository
github
Last release
3 years ago

sync-pom-version-to-package

npm npm GitHub issues

Travis Coveralls github David

Synchronizes the pom version to the package.json. Useful for applications that rely on maven pom's for building the application.

Usage

Auto sync version on postinstall

{
    "scripts": {
        "postinstall": "sync-pom-version"
    }
}

Auto sync from maven using the frontend-maven-plugin

First add script to package.json

{
    "scripts": {
        "sync-pom-version": "sync-pom-version"
    }
}

Setup the frontend-maven-plugin

<plugin>
    <groupId>com.github.eirslett</groupId>
    <artifactId>frontend-maven-plugin</artifactId>
    <version>1.6</version>
    <configuration>
        <nodeVersion>v6.9.1</nodeVersion>
        <yarnVersion>v0.16.1</yarnVersion>
    </configuration>
    <executions>
        <execution>
            <id>install node and yarn</id>
            <goals>
                <goal>install-node-and-yarn</goal>
            </goals>
        </execution>
        <execution>
            <id>sync version to package.json</id>
            <goals>
                <goal>yarn</goal>
            </goals>
            <configuration>
                <arguments>sync-pom-version</arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

Options

NameDescription
--prerelease-suffixSuffix string to apply to the version if it is a prerelease version. If the pom version is a release version, this value is ignored. This can be useful if you want your maven build to append a build number or timestamp to the version, so each build would push up a unique version for SNAPSHOT versions. So if I added --prerelease-suffix '.0' and the pom version is something like 1.0.0-SNAPSHOT, the resulting version would be 1.0.0-SNAPSHOT.0. But if the pom version was 1.0.0, the resulting version would still be 1.0.0.
--pom-fileLocation of the pom.xml file. Defaults to use ./pom.xml
--package-fileLocation of the package.json file. Defaults to use ./package.json
--use-yarnUse yarn to update version instead of npm

Adding options in the frontend-maven-plugin can be done by setting the arguments like this: <arguments>sync-pom-version -- --prerelease-version=.0</arguments> or <arguments>sync-pom-version -- --prerelease-version=.${BUILD_NUMBER}</arguments>

1.6.1

3 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

6 years ago

0.0.1-SNAPSHOT

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago