Hello all
It seems that it is not only me 1) finding it a bit unintuitive that the
"releaseProfile" parameter is only defined for the release:perform and
not for the release:prepare goal.
That way, in order to do a release, I currently need to say "mvn
release:prepare release:perform -PMyRelease -DreleaseProfiles=MyRelease"
Achieving the same outcome via "arguments" for example, which is defined
in AbstractReleaseMojo, works better. You do not need to specify the
profile name twice, but it is again not very intuitive: "mvn
release:prepare release:perform -Darguments=-PMyRelease"
As I understand, :prepare should verify that the release will go smooth
and therefore I think that the same profiles that will be active during
the actual release should be active during :prepare as well. Hence I
propose the below patch. What do others think about it?
Patrick
1) http://jira.codehaus.org/browse/MRELEASE-553,
http://jira.codehaus.org/browse/MRELEASE-410 ("[...] as for
release:perform, except that releaseProfiles values don't seem to be
taken into account for perform for some reason but that's another
problem [...]")
PS: please CC me on replies since I am not subscribed to the list
diff --git
a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
index ba96aea..9d1f892 100644
---
a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
+++
b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
@@ -75,6 +75,14 @@ public abstract class AbstractReleaseMojo
private String arguments;
/**
+ * Comma separated profiles to enable on deployment, in addition to
active profiles for project execution.
+ *
+ * @parameter expression="${releaseProfiles}"
+ * @since 2.0-beta-8
+ */
+ private String releaseProfiles;
+
+ /**
* The file name of the POM to execute any goals against.
*/
@Parameter( property = "pomFileName" )
diff --git
a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
index 2b031ee..e2326a2 100644
---
a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
+++
b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
@@ -53,14 +53,6 @@ public class PerformReleaseMojo
private String goals;
/**
- * Comma separated profiles to enable on deployment, in addition to
active profiles for project execution.
- *
- * @since 2.0-beta-8
- */
- @Parameter( property = "releaseProfiles" )
- private String releaseProfiles;
-
- /**
* The checkout directory.
*/
@Parameter( defaultValue = "${project.build.directory}/checkout",
property = "workingDirectory", required = true )