I am trying to run 2 maven goals in one maven command like:
mvn release:prepare release:perform -Darguments=\'-Dmaven.test.skip=true\'
but,
I have spent hours on this.
My working release command is:
-Darguments='-DskipTests=true' -DskipTests release:prepare release:perform
The problem actually was in my release plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<arguments>${release.arguments}</arguments>
The "arguments" parameter of the release plugin was overriding the -Darguments that I pass to the release:prepare (in order to be passed to release:perform by release:prepare).
You can use the following:
mvn -Dmaven.test.skip=true release:prepare release:perform
Within release-plugin the arguments are passed via -Darguments='....'
to the sub process which is started by release:perform
. The other arguments are passed to the process which is started by release:prepare
.