I would like to have different configuration options for different purposes of the Maven release plugin. The story is as follows:
I am using Git for SCM. I want a release: prepare a plug-in to do everything locally; and release: run to immediately transfer all changes to a remote repository.
I tried to do 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>
Version 1.7-SNAPSHOT is required for localCheckout = true to work in general (http://jira.codehaus.org/browse/SCM-662) if anyone is wondering about this.
With the settings mentioned above, all configuration parameters are completely ignored, but when I just specify 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 and release: complete that is not the desired result.
Edit
To make everything clear: while we use Git for SCM, we would like to have all the operations leading to the preparation of the release location, which is not without reason, given that the local Git repository is a full repo. However, when we do the actual release, we would like all the changes to be transferred to the upstream repository so that everything is installed correctly.
Can anyone help me with this?
source share