I'd like to have different configuration options for different goals of the Maven's release plugin. The story goes like this:
I'm using Git for an SCM. I want the release:prepare plugin to do everything locally and the release:perform to push all the changes at once to the remote repository.
I've tried doing something like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.2</version>
<executions>
<execution>
<id>release-prepare</id>
<configuration>
<pushChanges>false</pushChanges>
</configuration>
<goals>
<goal>prepare</goal>
</goals>
</execution>
<execution>
<id>release-perform</id>
<configuration>
<localCheckout>true</localCheckout>
<pushChanges>true</pushChanges>
</configuration>
<goals>
<goal>perform</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.7-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
The 1.7-SNAPSHOT version is required for localCheckout=true to work at all (http://jira.codehaus.org/browse/SCM-662) if anyone is wondering about that.
With the settings mentioned above all the configuration options are ignored completely but when I simply specify the settings like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.2</version>
<configuration>
<localCheckout>true</localCheckout>
<pushChanges>false</pushChanges>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.7-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
they apply to both release:prepare as well as release:perform which is not the desired outcome.
Edit:
To make things clear: while we're using Git for SCM we'd like to have all the operations leading to the preparation of a release local which is not without reason if you take into account that the local Git repository is a full-fledged repo anyways. However when we do the actual release we'd like all the changes to be pushed to upstream repository so that everything is properly set.
Could anyone help me out with it?