main
ROOT /
pages /
pom-build-version.md
19 lines | ISO-8859-1 | 748 bytes

Usage Scenario

Use POM project version as build version in Java maven project

How to Set Up

  1. Add a shell/batch step to extract project version from POM and write to a file:

    Detect Build Version

    Full command used in above screenshot:

    echo "Detecting project version (may require some time while downloading maven dependencies)..."
    echo $(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout) > buildVersion
    
  2. Add a step of type Set Build Version to set version using content of file buildVersion generated above:

    Set Build Version

Please wait...
Page is in error, reload to recover