Synchronizes the pom version to the package.json. Useful for applications that rely on maven pom's for building the application.
{
"scripts": {
"postinstall": "sync-pom-version"
}
}
{
"scripts": {
"sync-pom-version": "sync-pom-version"
}
}
<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>
Name | Description |
---|---|
--prerelease-suffix |
Suffix 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-file |
Location of the pom.xml file. Defaults to use ./pom.xml |
--package-file |
Location of the package.json file. Defaults to use ./package.json |
--use-yarn |
Use yarn to update version instead of npm |
Adding options in the
frontend-maven-plugin
can be done by setting thearguments
like this:<arguments>sync-pom-version -- --prerelease-version=.0</arguments>
or<arguments>sync-pom-version -- --prerelease-version=.${BUILD_NUMBER}</arguments>