maven release plugin and command line arguments

u123 picture u123 · Feb 11, 2014 · Viewed 9.5k times · Source

I am trying to do a non-interactive maven release:

mvn clean install \
  -PmyAssembly,attach-installer \
  -DcustomerFlag=simple \
  release:clean \
  release:prepare \
  release:perform \
  -DreleaseVersion=1.0.1 \
  -DdevelopmentVersion=1.0.2-SNAPSHOT \
  -Dtag=my-project-1.0.1

But the property -DcustomerFlag=simple is not set when running perform only when running prepare.

Do I need to specify all command line arguments and profile twice, once for prepare and once for perform ?

Alternatively I guess I can just skip the perform step and do a regular build/deploy afterwards with the parameters I need from the generated tag.

Answer

Robert Scholte picture Robert Scholte · Feb 16, 2014

None of the -D args from the commandline are passed by the maven-release-plugin to the inner Maven calls. You should use -Darguments="-DcustomerFlag=simple" to get the expected result, see arguments