You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

sync-pom-version-to-package

Package Overview
Dependencies
10
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

sync-pom-version-to-package

Sync's the maven project version to the package.json


Version published
Maintainers
1
Created

Readme

Source

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>

Keywords

FAQs

Package last updated on 28 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc