maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steph...@apache.org
Subject svn commit: r1039453 - in /maven/release/trunk: maven-release-manager/src/main/ maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ maven-release-manager...
Date Fri, 26 Nov 2010 16:41:47 GMT
Author: stephenc
Date: Fri Nov 26 16:41:46 2010
New Revision: 1039453

URL: http://svn.apache.org/viewvc?rev=1039453&view=rev
Log:
[MRELEASE-621] Implementing a new release phase after the preparation has been completed and
immediately before committing the next development versions back into SCM.

o This new feature can be used to hook in plugins that lock down version ranges for the release
and open them back up again after the release has been prepared, as well as other niceties
that people doing Continuous Deployment might well want.

Added:
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhase.java
      - copied, changed from r1039341, maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPrepareGoalsPhase.java
    maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhaseTest.java
      - copied, changed from r1039341, maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RunPrepareGoalsPhaseTest.java
    maven/release/trunk/maven-release-manager/src/test/resources/org/apache/maven/shared/release/phase/RunCompleteGoalsPhaseTest.xml
      - copied unchanged from r1039341, maven/release/trunk/maven-release-manager/src/test/resources/org/apache/maven/shared/release/phase/RunPrepareGoalsPhaseTest.xml
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/pom.xml
  (with props)
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/verify.bsh
Modified:
    maven/release/trunk/maven-release-manager/src/main/components-fragment.xml
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
    maven/release/trunk/maven-release-manager/src/main/mdo/release-descriptor.mdo
    maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java
    maven/release/trunk/maven-release-manager/src/test/resources/release.properties
    maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java

Modified: maven/release/trunk/maven-release-manager/src/main/components-fragment.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/components-fragment.xml?rev=1039453&r1=1039452&r2=1039453&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/components-fragment.xml (original)
+++ maven/release/trunk/maven-release-manager/src/main/components-fragment.xml Fri Nov 26
16:41:46 2010
@@ -54,6 +54,7 @@
           <phase>scm-tag</phase>
           <phase>rewrite-poms-for-development</phase>
           <phase>remove-release-poms</phase>
+          <phase>run-completion-goals</phase>
           <phase>scm-commit-development</phase>
           <phase>end-release</phase>
         </preparePhases>

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java?rev=1039453&r1=1039452&r2=1039453&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStore.java
Fri Nov 26 16:41:46 2010
@@ -83,7 +83,7 @@ public class PropertiesReleaseDescriptor
         {
             IOUtil.close( inStream );
         }
-        
+
         ReleaseDescriptor releaseDescriptor = ReleaseUtils.copyPropertiesToReleaseDescriptor(
properties );
 
         if ( mergeDescriptor != null )
@@ -159,9 +159,13 @@ public class PropertiesReleaseDescriptor
         {
             properties.setProperty( "preparationGoals", config.getPreparationGoals() );
         }
-        
+        if ( config.getCompletionGoals() != null )
+        {
+            properties.setProperty( "completionGoals", config.getCompletionGoals() );
+        }
+
         properties.setProperty( "remoteTagging", Boolean.toString( config.isRemoteTagging()
) );
-        
+
         properties.setProperty( "pushChanges", Boolean.toString( config.isPushChanges() )
);
 
         // others boolean properties are not written to the properties file because the value
from the caller is always used

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java?rev=1039453&r1=1039452&r2=1039453&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/config/ReleaseUtils.java
Fri Nov 26 16:41:46 2010
@@ -65,11 +65,13 @@ public class ReleaseUtils
         mergeInto.setScmPrivateKeyPassPhrase(
             mergeOverride( mergeInto.getScmPrivateKeyPassPhrase(), toBeMerged.getScmPrivateKeyPassPhrase()
) );
         mergeInto.setScmCommentPrefix(
-            mergeOverride( mergeInto.getScmCommentPrefix(), toBeMerged.getScmCommentPrefix()
) );        
+            mergeOverride( mergeInto.getScmCommentPrefix(), toBeMerged.getScmCommentPrefix()
) );
         mergeInto.setAdditionalArguments(
             mergeOverride( mergeInto.getAdditionalArguments(), toBeMerged.getAdditionalArguments()
) );
         mergeInto.setPreparationGoals(
             mergeOverride( mergeInto.getPreparationGoals(), toBeMerged.getPreparationGoals()
) );
+        mergeInto.setCompletionGoals(
+            mergeOverride( mergeInto.getCompletionGoals(), toBeMerged.getCompletionGoals()
) );
         mergeInto.setPerformGoals( mergeOverride( mergeInto.getPerformGoals(), toBeMerged.getPerformGoals()
) );
         mergeInto.setPomFileName( mergeOverride( mergeInto.getPomFileName(), toBeMerged.getPomFileName()
) );
         mergeInto.setCheckModificationExcludes( toBeMerged.getCheckModificationExcludes()
);
@@ -88,7 +90,7 @@ public class ReleaseUtils
         mergeInto.setAllowTimestampedSnapshots( toBeMerged.isAllowTimestampedSnapshots()
);
         mergeInto.setSnapshotReleasePluginAllowed( toBeMerged.isSnapshotReleasePluginAllowed()
);
         mergeInto.setAutoVersionSubmodules( toBeMerged.isAutoVersionSubmodules() );
-        mergeInto.setDefaultReleaseVersion( mergeOverride( mergeInto.getDefaultReleaseVersion(),

+        mergeInto.setDefaultReleaseVersion( mergeOverride( mergeInto.getDefaultReleaseVersion(),
                                                            toBeMerged.getDefaultReleaseVersion()
) );
         mergeInto.setDefaultDevelopmentVersion( mergeOverride( mergeInto.getDefaultDevelopmentVersion(),
                                                                toBeMerged.getDefaultDevelopmentVersion()
) );
@@ -97,7 +99,7 @@ public class ReleaseUtils
         mergeInto.setPushChanges( toBeMerged.isPushChanges() );
         mergeInto.setWaitBeforeTagging( toBeMerged.getWaitBeforeTagging() );
 
-        // If the user specifies versions, these should be override the existing versions

+        // If the user specifies versions, these should be override the existing versions
         if ( toBeMerged.getReleaseVersions() != null )
         {
             mergeInto.getReleaseVersions().putAll( toBeMerged.getReleaseVersions() );
@@ -127,7 +129,7 @@ public class ReleaseUtils
     {
         return thisValue != null ? thisValue : mergeValue;
     }
-    
+
     public static ReleaseDescriptor copyPropertiesToReleaseDescriptor( Properties properties
)
     {
         ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
@@ -144,6 +146,7 @@ public class ReleaseUtils
         releaseDescriptor.setAdditionalArguments( properties.getProperty( "exec.additionalArguments"
) );
         releaseDescriptor.setPomFileName( properties.getProperty( "exec.pomFileName" ) );
         releaseDescriptor.setPreparationGoals( properties.getProperty( "preparationGoals"
) );
+        releaseDescriptor.setCompletionGoals( properties.getProperty( "completionGoals" )
);
         String remoteTaggingStr = properties.getProperty( "remoteTagging" );
         releaseDescriptor.setRemoteTagging( remoteTaggingStr == null ? false : Boolean.valueOf(
remoteTaggingStr ).booleanValue() );
         String pushChanges = properties.getProperty( "pushChanges" );

Copied: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhase.java
(from r1039341, maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPrepareGoalsPhase.java)
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhase.java?p2=maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhase.java&p1=maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPrepareGoalsPhase.java&r1=1039341&r2=1039453&rev=1039453&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPrepareGoalsPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhase.java
Fri Nov 26 16:41:46 2010
@@ -19,21 +19,22 @@ package org.apache.maven.shared.release.
  * under the License.
  */
 
+import java.io.File;
+import java.util.List;
+
 import org.apache.maven.shared.release.ReleaseExecutionException;
 import org.apache.maven.shared.release.ReleaseResult;
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
 import org.apache.maven.shared.release.env.ReleaseEnvironment;
 
-import java.io.File;
-import java.util.List;
-
 /**
- * Run the integration tests for the project to verify that it builds before committing.
+ * Run the completion goals for the project to before committing the continuing development
stream.
  *
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
- * @plexus.component role="org.apache.maven.shared.release.phase.ReleasePhase" role-hint="run-preparation-goals"
+ * @author <a href="mailto:stephenc@apache.org">Stephen Connolly</a>
+ * @plexus.component role="org.apache.maven.shared.release.phase.ReleasePhase" role-hint="run-completion-goals"
  */
-public class RunPrepareGoalsPhase
+public class RunCompleteGoalsPhase
     extends AbstractRunGoalsPhase
 {
     public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment
releaseEnvironment, List reactorProjects )
@@ -48,7 +49,7 @@ public class RunPrepareGoalsPhase
     {
         ReleaseResult result = new ReleaseResult();
 
-        logInfo( result, "Executing preparation goals - since this is simulation mode it
is running against the " +
+        logInfo( result, "Executing completion goals - since this is simulation mode it is
running against the " +
             "original project, not the rewritten ones" );
 
         execute( releaseDescriptor, releaseEnvironment, reactorProjects );
@@ -58,6 +59,6 @@ public class RunPrepareGoalsPhase
 
     protected String getGoals( ReleaseDescriptor releaseDescriptor )
     {
-        return releaseDescriptor.getPreparationGoals();
+        return releaseDescriptor.getCompletionGoals();
     }
 }

Modified: maven/release/trunk/maven-release-manager/src/main/mdo/release-descriptor.mdo
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/mdo/release-descriptor.mdo?rev=1039453&r1=1039452&r2=1039453&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/mdo/release-descriptor.mdo (original)
+++ maven/release/trunk/maven-release-manager/src/main/mdo/release-descriptor.mdo Fri Nov
26 16:41:46 2010
@@ -326,6 +326,14 @@
           </description>
         </field>
         <field>
+          <name>completionGoals</name>
+          <version>2.2.0+</version>
+          <type>String</type>
+          <description>
+            The goals to execute in on completion of preparation for the release.
+          </description>
+        </field>
+        <field>
           <name>performGoals</name>
           <version>1.0.0+</version>
           <type>String</type>
@@ -437,7 +445,7 @@
             the source code with this revision.
           </description>
         </field>
-        
+
         <field>
           <name>pushChanges</name>
           <version>2.0.0+</version>
@@ -448,8 +456,8 @@
             For many distributed SCMs like Git, a change like a commit is only stored in
your local copy of the repository.
             Pushing the change allows your to more easily share it with other users.
           </description>
-        </field>        
-        
+        </field>
+
         <field>
           <name>localCheckout</name>
           <version>2.0.0+</version>
@@ -720,6 +728,10 @@
         {
             return false;
         }
+        if ( !saveEquals( completionGoals, that.completionGoals ) )
+        {
+            return false;
+        }
         if ( !saveEquals( pomFileName, that.pomFileName ) )
         {
             return false;
@@ -828,6 +840,7 @@
         result = 29 * result + ( scmReleaseLabel != null ? scmReleaseLabel.hashCode() : 0
);
         result = 29 * result + ( additionalArguments != null ? additionalArguments.hashCode()
: 0 );
         result = 29 * result + ( preparationGoals != null ? preparationGoals.hashCode() :
0 );
+        result = 29 * result + ( completionGoals != null ? completionGoals.hashCode() : 0
);
         result = 29 * result + ( pomFileName != null ? pomFileName.hashCode() : 0 );
         result = 29 * result + ( checkModificationExcludes != null ? checkModificationExcludes.hashCode()
: 0 );
         result = 29 * result + ( scmTagBase != null ? scmTagBase.hashCode() : 0 );

Modified: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java?rev=1039453&r1=1039452&r2=1039453&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java
(original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java
Fri Nov 26 16:41:46 2010
@@ -277,6 +277,7 @@ public class PropertiesReleaseDescriptor
         config.setScmReleaseLabel( "tag-write" );
         config.setAdditionalArguments( "additional-args-write" );
         config.setPreparationGoals( "preparation-goals-write" );
+        config.setCompletionGoals( "completion-goals-write" );
         config.setPomFileName( "pom-file-name-write" );
 
         config.mapReleaseVersion( "groupId:artifactId", "1.0" );
@@ -309,6 +310,7 @@ public class PropertiesReleaseDescriptor
         assertNull( "Expected no tag", config.getScmReleaseLabel() );
         assertNull( "Expected no additional arguments", config.getAdditionalArguments() );
         assertNull( "Expected no preparation goals", config.getPreparationGoals() );
+        assertNull( "Expected no completion goals", config.getCompletionGoals() );
         assertNull( "Expected no pom file name", config.getPomFileName() );
 
         assertNull( "Expected no workingDirectory", config.getWorkingDirectory() );
@@ -350,6 +352,7 @@ public class PropertiesReleaseDescriptor
         expected.setScmReleaseLabel( "tag" );
         expected.setAdditionalArguments( "additional-arguments" );
         expected.setPreparationGoals( "preparation-goals" );
+        expected.setCompletionGoals( "completion-goals" );
         expected.setPomFileName( "pom-file-name" );
         expected.setWorkingDirectory( null );
         expected.setGenerateReleasePoms( false );

Copied: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhaseTest.java
(from r1039341, maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RunPrepareGoalsPhaseTest.java)
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhaseTest.java?p2=maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhaseTest.java&p1=maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RunPrepareGoalsPhaseTest.java&r1=1039341&r2=1039453&rev=1039453&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RunPrepareGoalsPhaseTest.java
(original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RunCompleteGoalsPhaseTest.java
Fri Nov 26 16:41:46 2010
@@ -19,6 +19,9 @@ package org.apache.maven.shared.release.
  * under the License.
  */
 
+import java.io.File;
+import java.util.List;
+
 import org.apache.maven.settings.Settings;
 import org.apache.maven.shared.release.ReleaseExecutionException;
 import org.apache.maven.shared.release.ReleaseFailureException;
@@ -36,25 +39,22 @@ import org.jmock.core.matcher.InvokeOnce
 import org.jmock.core.matcher.TestFailureMatcher;
 import org.jmock.core.stub.ThrowStub;
 
-import java.io.File;
-import java.util.List;
-
 /**
  * Test the simple test running phase.
  *
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  */
-public class RunPrepareGoalsPhaseTest
+public class RunCompleteGoalsPhaseTest
     extends PlexusTestCase
 {
-    private RunPrepareGoalsPhase phase;
+    private RunCompleteGoalsPhase phase;
 
     protected void setUp()
         throws Exception
     {
         super.setUp();
 
-        phase = (RunPrepareGoalsPhase) lookup( ReleasePhase.ROLE, "run-preparation-goals"
);
+        phase = (RunCompleteGoalsPhase) lookup( ReleasePhase.ROLE, "run-completion-goals"
);
     }
 
     public void testExecute()
@@ -63,7 +63,7 @@ public class RunPrepareGoalsPhaseTest
         File testFile = getTestFile( "target/working-directory" );
 
         ReleaseDescriptor config = new ReleaseDescriptor();
-        config.setPreparationGoals( "clean integration-test" );
+        config.setCompletionGoals( "clean integration-test" );
         config.setWorkingDirectory( testFile.getAbsolutePath() );
 
         Mock mock = new Mock( MavenExecutor.class );
@@ -86,7 +86,7 @@ public class RunPrepareGoalsPhaseTest
         File testFile = getTestFile( "target/working-directory" );
 
         ReleaseDescriptor config = new ReleaseDescriptor();
-        config.setPreparationGoals( "clean integration-test" );
+        config.setCompletionGoals( "clean integration-test" );
         config.setWorkingDirectory( testFile.getAbsolutePath() );
 
         Mock mock = new Mock( MavenExecutor.class );
@@ -108,7 +108,7 @@ public class RunPrepareGoalsPhaseTest
         File testFile = getTestFile( "target/working-directory" );
 
         ReleaseDescriptor config = new ReleaseDescriptor();
-        config.setPreparationGoals( "clean integration-test" );
+        config.setCompletionGoals( "clean integration-test" );
         config.setWorkingDirectory( testFile.getAbsolutePath() );
 
         Mock mock = new Mock( MavenExecutor.class );
@@ -136,7 +136,7 @@ public class RunPrepareGoalsPhaseTest
         File testFile = getTestFile( "target/working-directory" );
 
         ReleaseDescriptor config = new ReleaseDescriptor();
-        config.setPreparationGoals( "clean integration-test" );
+        config.setCompletionGoals( "clean integration-test" );
         config.setWorkingDirectory( testFile.getAbsolutePath() );
 
         Mock mock = new Mock( MavenExecutor.class );
@@ -165,7 +165,7 @@ public class RunPrepareGoalsPhaseTest
         File testFile = getTestFile( "target/working-directory" );
 
         ReleaseDescriptor config = new ReleaseDescriptor();
-        config.setPreparationGoals( "" );
+        config.setCompletionGoals( "" );
         config.setWorkingDirectory( testFile.getAbsolutePath() );
 
         Mock mock = new Mock( MavenExecutor.class );

Modified: maven/release/trunk/maven-release-manager/src/test/resources/release.properties
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/resources/release.properties?rev=1039453&r1=1039452&r2=1039453&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/resources/release.properties (original)
+++ maven/release/trunk/maven-release-manager/src/test/resources/release.properties Fri Nov
26 16:41:46 2010
@@ -31,6 +31,7 @@ exec.additionalArguments=additional-argu
 exec.pomFileName=pom-file-name
 
 preparationGoals=preparation-goals
+completionGoals=completion-goals
 
 project.rel.groupId\:artifactId1=2.0
 project.rel.groupId\:artifactId2=3.0

Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/pom.xml?rev=1039453&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/pom.xml
(added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/pom.xml
Fri Nov 26 16:41:46 2010
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.release</groupId>
+  <artifactId>completion-goals</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Release Plugin IT</name>
+  <url>http://maven.apache.org/</url>
+
+  <scm>
+    <connection>scm:dummy|nul</connection>
+    <developerConnection>scm:dummy|nul</developerConnection>
+  </scm>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-release-plugin</artifactId>
+        <version>@project.version@</version>
+        <configuration>
+          <arguments>-Dflag -Dfoo=bar -s "@project.build.directory@/it/interpolated-settings.xml"</arguments>
+          <mavenExecutorId>invoker</mavenExecutorId>
+          <goals>validate</goals>
+          <preparationGoals>validate</preparationGoals>
+          <completionGoals>verify</completionGoals>
+        </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.maven.its.release</groupId>
+            <artifactId>maven-scm-provider-dummy</artifactId>
+            <version>1.0</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/verify.bsh
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/verify.bsh?rev=1039453&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/verify.bsh
(added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare/completion-goals/verify.bsh
Fri Nov 26 16:41:46 2010
@@ -0,0 +1,60 @@
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+    File buildLog = new File( basedir, "build.log" );
+
+    System.out.println( "Checking logs.." );
+
+    StringBuffer data = new StringBuffer( 1024 );
+    BufferedReader reader = new BufferedReader( new FileReader( buildLog ) );
+    char[] buf = new char[1024];
+    int numRead = 0;
+    while ( ( numRead = reader.read( buf ) ) != -1 )
+    {
+        String readData = String.valueOf( buf, 0, numRead );
+        data.append( readData );
+        buf = new char[1024];
+    }
+    reader.close();
+    String contents = data.toString();
+
+    String expected = "Executing preparation goals";
+    int index = 0;
+
+    if( ( index = contents.indexOf( expected, index ) ) == -1 )
+    {
+        System.out.println( "FAILED!" );
+        return false;
+    }
+    expected = "Executing goals 'validate'";
+
+    if( ( index = contents.indexOf( expected, index ) ) == -1 )
+    {
+        System.out.println( "FAILED!" );
+        return false;
+    }
+    expected = "Executing completion goals";
+
+    if( ( index = contents.indexOf( expected, index ) ) == -1 )
+    {
+        System.out.println( "FAILED!" );
+        return false;
+    }
+    expected = "Executing goals 'verify'";
+
+    if( ( index = contents.indexOf( expected, index ) ) == -1 )
+    {
+        System.out.println( "FAILED!" );
+        return false;
+    }
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;
\ No newline at end of file

Modified: maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java?rev=1039453&r1=1039452&r2=1039453&view=diff
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
(original)
+++ maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
Fri Nov 26 16:41:46 2010
@@ -111,6 +111,15 @@ public class PrepareReleaseMojo
     private String preparationGoals;
 
     /**
+     * Goals to run on completion of the preparation step, after transformation back to the
next development version
+     * but before committing. Space delimited.
+     *
+     * @parameter expression="${completionGoals}" default-value=""
+     * @since 2.2
+     */
+    private String completionGoals;
+
+    /**
      * Commits to do are atomic or by project.
      *
      * @parameter expression="${commitByProject}" default-value="false"
@@ -260,6 +269,7 @@ public class PrepareReleaseMojo
         config.setGenerateReleasePoms( generateReleasePoms );
         config.setScmUseEditMode( useEditMode );
         config.setPreparationGoals( preparationGoals );
+        config.setCompletionGoals( completionGoals );
         config.setCommitByProject( commitByProject );
         config.setUpdateDependencies( updateDependencies );
         config.setAutoVersionSubmodules( autoVersionSubmodules );



Mime
View raw message