You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2006/05/03 05:19:42 UTC

svn commit: r399115 - in /maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release: DefaultReleaseManager.java PerformReleaseMojo.java ReleaseManager.java

Author: brett
Date: Tue May  2 20:19:40 2006
New Revision: 399115

URL: http://svn.apache.org/viewcvs?rev=399115&view=rev
Log:
[MRELEASE-98] add release profile by default, configuration to turn it off

Modified:
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/DefaultReleaseManager.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseManager.java

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/DefaultReleaseManager.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/DefaultReleaseManager.java?rev=399115&r1=399114&r2=399115&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/DefaultReleaseManager.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/DefaultReleaseManager.java Tue May  2 20:19:40 2006
@@ -34,6 +34,7 @@
 import org.apache.maven.scm.repository.ScmRepositoryException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
 import java.io.IOException;
@@ -151,7 +152,8 @@
         }
     }
 
-    public void perform( ReleaseConfiguration releaseConfiguration, File checkoutDirectory, String goals )
+    public void perform( ReleaseConfiguration releaseConfiguration, File checkoutDirectory, String goals,
+                         boolean useReleaseProfile )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         getLogger().info( "Checking out the project to perform the release ..." );
@@ -219,10 +221,24 @@
             throw new ReleaseScmCommandException( "Unable to checkout from SCM", result );
         }
 
+        String additionalArguments = config.getAdditionalArguments();
+
+        if ( useReleaseProfile )
+        {
+            if ( !StringUtils.isEmpty( additionalArguments ) )
+            {
+                additionalArguments = additionalArguments + " -DperformRelease=true";
+            }
+            else
+            {
+                additionalArguments = "-DperformRelease=true";
+            }
+        }
+
         try
         {
             mavenExecutor.executeGoals( checkoutDirectory, goals, config.isInteractive(), config.getPomFileName(),
-                                        config.getAdditionalArguments() );
+                                        additionalArguments );
         }
         catch ( MavenExecutorException e )
         {

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java?rev=399115&r1=399114&r2=399115&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java Tue May  2 20:19:40 2006
@@ -56,6 +56,13 @@
      */
     private String scmUrl;
 
+    /**
+     * Whether to use the release profile that adds sources and javadocs to the released artifact, if appropriate.
+     *
+     * @parameter expression="${useReleaseProfile}" default-value="true"
+     */
+    private boolean useReleaseProfile;
+
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
@@ -68,7 +75,7 @@
                 releaseConfiguration.setUrl( scmUrl );
             }
 
-            releaseManager.perform( releaseConfiguration, workingDirectory, goals );
+            releaseManager.perform( releaseConfiguration, workingDirectory, goals, useReleaseProfile );
         }
         catch ( ReleaseExecutionException e )
         {

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseManager.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseManager.java?rev=399115&r1=399114&r2=399115&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseManager.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/ReleaseManager.java Tue May  2 20:19:40 2006
@@ -60,10 +60,12 @@
      * @param releaseConfiguration the configuration to use for release
      * @param checkoutDirectory    the location to checkout to and build from
      * @param goals                the goals to execute
+     * @param useReleaseProfile    whether to use the release profile from the super POM or not
      * @throws ReleaseExecutionException if there is a problem performing the release
      * @throws ReleaseFailureException   if there is a problem performing the release
      */
-    void perform( ReleaseConfiguration releaseConfiguration, File checkoutDirectory, String goals )
+    void perform( ReleaseConfiguration releaseConfiguration, File checkoutDirectory, String goals,
+                  boolean useReleaseProfile )
         throws ReleaseExecutionException, ReleaseFailureException;
 
     /**