Maven AntRun + Release Plugin == argument problems

Scenario: The company had multiple mobile applications (Android, iOS, BB, PalmOS) with build scripts written in ANT.

I wanted to utilize MVN for the sake of dependency management, package repository, release versioning, and automatic branching / tagging of SVN. Therefore, I wrapped MVN around ANT via AntRun plugin and implemented the Release Plugin.

We hit a snag when MVN was calling ANT. How do I pass the args to MVN and onto ANT? Solution: -Darguments

mvn release:clean release:prepare -Darguments=-Dplatform=iPhone -Dprovisioning_profile=some_profile -Denv=test

The pom.xml looks like:

...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
<configuration />
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>clean</id>
<phase>clean</phase>
<configuration>
<target>
<property name="env" value="${env}" />
<property name="provisioning_profile" value="${provisioning_profile}" />
<property name="platform" value="${platform}" />
<ant antfile="./src/build.xml" target="clean" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>package</id>
<phase>package</phase>
<configuration>
<target>
<property name="env" value="${env}" />
<property name="provisioning_profile" value="${provisioning_profile}" />
<property name="platform" value="${platform}" />
<ant antfile="./src/build.xml" target="checkout_build_ftp" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...

Maven release plugin local modifications

You are trying to do a release

cmuser@cmlin01:~$ mvn release:prepare -DreleaseVersion=1.0.0.RC1 -DdryRun=true

And you see an error like:

...
[INFO] [INFO] Working directory: C:workspacesHelloWorldbranchesHelloWorld-1_0component1
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] BUILD ERROR
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Cannot create the build number because you have local modifications :
[INFO] [pom.xml.releaseBackup:unknown]
[INFO] [pom.xml.tag:unknown]
[INFO] [release.properties:unknown]
...

To fix, you need to have SVN ignoring those files.

cmuser@cmlin01:~$ vi /home/cmuser/.subversion/config 
...
global-ignores = pom.xml.* release.properties
...

Now run it again.

mvn release:prepare -DreleaseVersion=1.0.0.RC1 -DdryRun=true