Maven Release Plugin and Jazz SCM: Prepare

The Jazz scm command does not seem to play nice with maven-release-plugin.

When doing a mvn release:prepare, things are going fine, until, at the very end, Maven returns a build failure:

Error code for Jazz SCM deliver command - 53

After a quick internet search, it turned out that error code 53 "Indicates that a deliver succeeded, but there were no changes to deliver to the repository".

Well... ok...

Luckily, the Jazz scm command is nothing more than a shell script! So it was very easy to change that "error code that means success" into an actual 0 that Maven expects from successful executions:

if [ "$USE_NATIVE" = "1" ]; then
    "${PRGPATH}/fec" "$@"
else
    java -classpath "${PRGPATH}/plugins/com.ibm.team.filesystem.cli.minimal_3.1.600.v20140108_0240.jar:${PRGPATH}/plugins/com.ibm.team.rtc.cli.infrastructure_3.1.800.v20140619_0246.jar:${PRGPATH}/plugins/com.ibm.team.filesystem.cli.core_3.2.400.v20141011_0139.jar:${PRGPATH}/plugins/com.ibm.team.filesystem.client.daemon_3.1.500.v20130930_0113.jar:${PRGPATH}/plugins/org.eclipse.equinox.common_3.6.0.v20100503.jar:${PRGPATH}/plugins/com.ibm.team.filesystem.client_3.2.400.v20141015_1622.jar:${PRGPATH}/plugins/org.eclipse.osgi_3.6.50.R36x_v20120315-1500.jar:${PRGPATH}/plugins/com.ibm.team.repository.common_1.4.200.v20141015_2351.jar" com.ibm.team.filesystem.cli.minimal.client.FrontEndClient "$0" "$@"
fi

required addition of just a couple of lines right below:

RESULT=$?

if [[ $RESULT -eq 53 || $RESULT -eq 52 ]]; then
  exit 0
else
  exit $RESULT
fi

And that's it! The mvn release:prepare command completes successfully.

Unfortunately, running mvn release:perform yields yet another error, that I'll discuss some other day.