maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r399113 - in /maven/plugins/trunk/maven-release-plugin/src: main/java/org/apache/maven/plugins/release/ main/java/org/apache/maven/plugins/release/config/ main/java/org/apache/maven/plugins/release/phase/ main/resources/META-INF/plexus/ tes...
Date Wed, 03 May 2006 03:09:48 GMT
Author: brett
Date: Tue May  2 20:09:44 2006
New Revision: 399113

URL: http://svn.apache.org/viewcvs?rev=399113&view=rev
Log:
[MRELEASE-98] implement clean

Added:
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/CleanReleaseMojo.java
  (with props)
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractReleasePhase.java
  (with props)
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/EndReleasePhase.java
  (with props)
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/ReleaseManager.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/ReleaseConfigurationStore.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractRewritePomsPhase.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhase.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckPomPhase.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/GenerateReleasePomsPhase.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/InputVariablesPhase.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/MapVersionsPhase.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ReleasePhase.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RemoveReleasePomsPhase.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RunGoalsPhase.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCheckModificationsPhase.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCommitPhase.java
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmTagPhase.java
    maven/plugins/trunk/maven-release-plugin/src/main/resources/META-INF/plexus/components.xml
    maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/config/ReleaseConfigurationStoreStub.java
    maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java

Added: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/CleanReleaseMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/CleanReleaseMojo.java?rev=399113&view=auto
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/CleanReleaseMojo.java
(added)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/CleanReleaseMojo.java
Tue May  2 20:09:44 2006
@@ -0,0 +1,50 @@
+package org.apache.maven.plugins.release;
+
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.release.config.ReleaseConfiguration;
+
+import java.util.List;
+
+/**
+ * Clean up after a release preparation.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @version $Id$
+ * @aggregator
+ * @goal clean
+ */
+public class CleanReleaseMojo
+    extends AbstractReleaseMojo
+{
+    /**
+     * @parameter expression="${reactorProjects}"
+     * @required
+     * @readonly
+     */
+    private List reactorProjects;
+
+    public void execute()
+        throws MojoExecutionException, MojoFailureException
+    {
+        ReleaseConfiguration releaseConfiguration = new ReleaseConfiguration();
+        releaseConfiguration.setReactorProjects( reactorProjects );
+        releaseManager.clean( releaseConfiguration );
+    }
+}

Propchange: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/CleanReleaseMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/CleanReleaseMojo.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

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=399113&r1=399112&r2=399113&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:09:44 2006
@@ -37,6 +37,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -165,6 +166,13 @@
             throw new ReleaseExecutionException( "Error reading stored configuration: " +
e.getMessage(), e );
         }
 
+        // if we stopped mid-way through preparation - don't perform
+        if ( config.getCompletedPhase() != null && !"end-release".equals( config.getCompletedPhase()
) )
+        {
+            throw new ReleaseFailureException(
+                "Cannot perform release - the preparation step was stopped mid-way. Please
re-run release:prepare to continue, or perform the release from an SCM tag." );
+        }
+
         ScmRepository repository;
         ScmProvider provider;
         try
@@ -221,20 +229,21 @@
             throw new ReleaseExecutionException( "Error executing Maven: " + e.getMessage(),
e );
         }
 
-        clean();
+        clean( config );
     }
 
-    public void clean()
+    public void clean( ReleaseConfiguration releaseConfiguration )
     {
-        // TODO: this, tag, next, backup poms [!] -- test backup pom is generated
-/*
-        File releaseProperties = new File( basedir, "release.properties" );
+        getLogger().info( "Cleaning up after release..." );
 
-        if ( releaseProperties.exists() )
+        configStore.delete( releaseConfiguration );
+
+        for ( Iterator i = releasePhases.values().iterator(); i.hasNext(); )
         {
-            releaseProperties.delete();
+            ReleasePhase phase = (ReleasePhase) i.next();
+
+            phase.clean( releaseConfiguration );
         }
-*/
     }
 
     void setConfigStore( ReleaseConfigurationStore configStore )

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=399113&r1=399112&r2=399113&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:09:44 2006
@@ -68,6 +68,8 @@
 
     /**
      * Clean a release.
+     *
+     * @param releaseConfiguration the configuration to use for release
      */
-    void clean();
+    void clean( ReleaseConfiguration releaseConfiguration );
 }

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java
Tue May  2 20:09:44 2006
@@ -142,6 +142,15 @@
         write( config, getDefaultReleasePropertiesFile( config ) );
     }
 
+    public void delete( ReleaseConfiguration config )
+    {
+        File file = getDefaultReleasePropertiesFile( config );
+        if ( file.exists() )
+        {
+            file.delete();
+        }
+    }
+
     public void write( ReleaseConfiguration config, File file )
         throws ReleaseConfigurationStoreException
     {

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/ReleaseConfigurationStore.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/ReleaseConfigurationStore.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/ReleaseConfigurationStore.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/ReleaseConfigurationStore.java
Tue May  2 20:09:44 2006
@@ -45,4 +45,11 @@
      */
     void write( ReleaseConfiguration config )
         throws ReleaseConfigurationStoreException;
+
+    /**
+     * Remove a configuration.
+     *
+     * @param config the location of the configuration
+     */
+    void delete( ReleaseConfiguration config );
 }

Added: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractReleasePhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractReleasePhase.java?rev=399113&view=auto
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractReleasePhase.java
(added)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractReleasePhase.java
Tue May  2 20:09:44 2006
@@ -0,0 +1,35 @@
+package org.apache.maven.plugins.release.phase;
+
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+import org.apache.maven.plugins.release.config.ReleaseConfiguration;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+/**
+ * Base class for all phases.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public abstract class AbstractReleasePhase
+    extends AbstractLogEnabled
+    implements ReleasePhase
+{
+    public void clean( ReleaseConfiguration config )
+    {
+        // nothing to do by default
+    }
+}

Propchange: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractReleasePhase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractReleasePhase.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractRewritePomsPhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractRewritePomsPhase.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractRewritePomsPhase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractRewritePomsPhase.java
Tue May  2 20:09:44 2006
@@ -35,7 +35,6 @@
 import org.apache.maven.scm.provider.ScmProvider;
 import org.apache.maven.scm.repository.ScmRepository;
 import org.apache.maven.scm.repository.ScmRepositoryException;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
 import org.jdom.Document;
@@ -65,8 +64,7 @@
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  */
 public abstract class AbstractRewritePomsPhase
-    extends AbstractLogEnabled
-    implements ReleasePhase
+    extends AbstractReleasePhase
 {
     /**
      * Tool that gets a configured SCM repository from release configuration.
@@ -487,6 +485,22 @@
         throws ReleaseExecutionException, ReleaseFailureException
     {
         transform( releaseConfiguration, true );
+    }
+
+    public void clean( ReleaseConfiguration config )
+    {
+        super.clean( config );
+
+        for ( Iterator i = config.getReactorProjects().iterator(); i.hasNext(); )
+        {
+            MavenProject project = (MavenProject) i.next();
+
+            File file = new File( project.getFile().getParentFile(), project.getFile().getName()
+ "." + pomSuffix );
+            if ( file.exists() )
+            {
+                file.delete();
+            }
+        }
     }
 
     protected abstract Map getOriginalVersionMap( ReleaseConfiguration releaseConfiguration
);

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhase.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhase.java
Tue May  2 20:09:44 2006
@@ -22,7 +22,6 @@
 import org.apache.maven.plugins.release.ReleaseFailureException;
 import org.apache.maven.plugins.release.config.ReleaseConfiguration;
 import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -40,8 +39,7 @@
  * @todo plugins injected by the lifecycle are not tested here. They will be injected with
a RELEASE version so are covered under the above point.
  */
 public class CheckDependencySnapshotsPhase
-    extends AbstractLogEnabled
-    implements ReleasePhase
+    extends AbstractReleasePhase
 {
     public void execute( ReleaseConfiguration releaseConfiguration )
         throws ReleaseExecutionException, ReleaseFailureException

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckPomPhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckPomPhase.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckPomPhase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/CheckPomPhase.java
Tue May  2 20:09:44 2006
@@ -32,7 +32,7 @@
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  */
 public class CheckPomPhase
-    implements ReleasePhase
+    extends AbstractReleasePhase
 {
     public void execute( ReleaseConfiguration releaseConfiguration )
         throws ReleaseExecutionException, ReleaseFailureException

Added: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/EndReleasePhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/EndReleasePhase.java?rev=399113&view=auto
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/EndReleasePhase.java
(added)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/EndReleasePhase.java
Tue May  2 20:09:44 2006
@@ -0,0 +1,43 @@
+package org.apache.maven.plugins.release.phase;
+
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+import org.apache.maven.plugins.release.ReleaseExecutionException;
+import org.apache.maven.plugins.release.ReleaseFailureException;
+import org.apache.maven.plugins.release.config.ReleaseConfiguration;
+
+/**
+ * Finalise release preparation so it can be flagged complete..
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public class EndReleasePhase
+    extends AbstractReleasePhase
+{
+
+    public void execute( ReleaseConfiguration releaseConfiguration )
+        throws ReleaseExecutionException, ReleaseFailureException
+    {
+        getLogger().info( "Release preparation complete." );
+    }
+
+    public void simulate( ReleaseConfiguration releaseConfiguration )
+        throws ReleaseExecutionException, ReleaseFailureException
+    {
+        getLogger().info( "Release preparation simulation complete." );
+    }
+}

Propchange: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/EndReleasePhase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/EndReleasePhase.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/GenerateReleasePomsPhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/GenerateReleasePomsPhase.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/GenerateReleasePomsPhase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/GenerateReleasePomsPhase.java
Tue May  2 20:09:44 2006
@@ -18,7 +18,6 @@
 
 import org.apache.maven.plugins.release.ReleaseExecutionException;
 import org.apache.maven.plugins.release.config.ReleaseConfiguration;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 /**
  * Generate release POMs.
@@ -26,8 +25,7 @@
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  */
 public class GenerateReleasePomsPhase
-    extends AbstractLogEnabled
-    implements ReleasePhase
+    extends AbstractReleasePhase
 {
     public void execute( ReleaseConfiguration releaseConfiguration )
         throws ReleaseExecutionException

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/InputVariablesPhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/InputVariablesPhase.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/InputVariablesPhase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/InputVariablesPhase.java
Tue May  2 20:09:44 2006
@@ -22,7 +22,6 @@
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.components.interactivity.Prompter;
 import org.codehaus.plexus.components.interactivity.PrompterException;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 /**
  * Input any variables that were not yet configured.
@@ -30,8 +29,7 @@
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  */
 public class InputVariablesPhase
-    extends AbstractLogEnabled
-    implements ReleasePhase
+    extends AbstractReleasePhase
 {
     /**
      * Component used to prompt for input.

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/MapVersionsPhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/MapVersionsPhase.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/MapVersionsPhase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/MapVersionsPhase.java
Tue May  2 20:09:44 2006
@@ -25,7 +25,6 @@
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.components.interactivity.Prompter;
 import org.codehaus.plexus.components.interactivity.PrompterException;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.util.Iterator;
 
@@ -35,8 +34,7 @@
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  */
 public class MapVersionsPhase
-    extends AbstractLogEnabled
-    implements ReleasePhase
+    extends AbstractReleasePhase
 {
     /**
      * Whether to convert to a snapshot or a release.

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ReleasePhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ReleasePhase.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ReleasePhase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ReleasePhase.java
Tue May  2 20:09:44 2006
@@ -51,4 +51,11 @@
      */
     void simulate( ReleaseConfiguration releaseConfiguration )
         throws ReleaseExecutionException, ReleaseFailureException;
+
+    /**
+     * Clean up after a phase if it leaves any additional files in the checkout.
+     *
+     * @param config the configuration to use
+     */
+    void clean( ReleaseConfiguration config );
 }

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RemoveReleasePomsPhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RemoveReleasePomsPhase.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RemoveReleasePomsPhase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RemoveReleasePomsPhase.java
Tue May  2 20:09:44 2006
@@ -18,7 +18,6 @@
 
 import org.apache.maven.plugins.release.ReleaseExecutionException;
 import org.apache.maven.plugins.release.config.ReleaseConfiguration;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 /**
  * Remove release POMs.
@@ -26,8 +25,7 @@
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  */
 public class RemoveReleasePomsPhase
-    extends AbstractLogEnabled
-    implements ReleasePhase
+    extends AbstractReleasePhase
 {
     public void execute( ReleaseConfiguration releaseConfiguration )
         throws ReleaseExecutionException

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RunGoalsPhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RunGoalsPhase.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RunGoalsPhase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/RunGoalsPhase.java
Tue May  2 20:09:44 2006
@@ -20,7 +20,6 @@
 import org.apache.maven.plugins.release.config.ReleaseConfiguration;
 import org.apache.maven.plugins.release.exec.MavenExecutor;
 import org.apache.maven.plugins.release.exec.MavenExecutorException;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
@@ -29,8 +28,7 @@
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  */
 public class RunGoalsPhase
-    extends AbstractLogEnabled
-    implements ReleasePhase
+    extends AbstractReleasePhase
 {
     /**
      * Component to assist in executing Maven.

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCheckModificationsPhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCheckModificationsPhase.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCheckModificationsPhase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCheckModificationsPhase.java
Tue May  2 20:09:44 2006
@@ -30,7 +30,6 @@
 import org.apache.maven.scm.provider.ScmProvider;
 import org.apache.maven.scm.repository.ScmRepository;
 import org.apache.maven.scm.repository.ScmRepositoryException;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.util.Arrays;
 import java.util.HashSet;
@@ -44,8 +43,7 @@
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  */
 public class ScmCheckModificationsPhase
-    extends AbstractLogEnabled
-    implements ReleasePhase
+    extends AbstractReleasePhase
 {
     /**
      * Tool that gets a configured SCM repository from release configuration.

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCommitPhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCommitPhase.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCommitPhase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmCommitPhase.java
Tue May  2 20:09:44 2006
@@ -30,7 +30,6 @@
 import org.apache.maven.scm.provider.ScmProvider;
 import org.apache.maven.scm.repository.ScmRepository;
 import org.apache.maven.scm.repository.ScmRepositoryException;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.io.File;
 import java.text.MessageFormat;
@@ -45,8 +44,7 @@
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  */
 public class ScmCommitPhase
-    extends AbstractLogEnabled
-    implements ReleasePhase
+    extends AbstractReleasePhase
 {
     /**
      * Tool that gets a configured SCM repository from release configuration.

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmTagPhase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmTagPhase.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmTagPhase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/ScmTagPhase.java
Tue May  2 20:09:44 2006
@@ -29,7 +29,6 @@
 import org.apache.maven.scm.provider.ScmProvider;
 import org.apache.maven.scm.repository.ScmRepository;
 import org.apache.maven.scm.repository.ScmRepositoryException;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 /**
  * Tag the SCM repository after committing the release.
@@ -37,8 +36,7 @@
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  */
 public class ScmTagPhase
-    extends AbstractLogEnabled
-    implements ReleasePhase
+    extends AbstractReleasePhase
 {
     /**
      * Tool that gets a configured SCM repository from release configuration.

Modified: maven/plugins/trunk/maven-release-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/resources/META-INF/plexus/components.xml?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/resources/META-INF/plexus/components.xml
Tue May  2 20:09:44 2006
@@ -53,6 +53,7 @@
           <phase>rewrite-poms-for-development</phase>
           <phase>remove-release-poms</phase>
           <phase>scm-commit-development</phase>
+          <phase>end-release</phase>
         </phases>
       </configuration>
     </component>
@@ -229,6 +230,11 @@
     <component>
       <role>org.apache.maven.plugins.release.exec.CommandLineFactory</role>
       <implementation>org.apache.maven.plugins.release.exec.DefaultCommandLineFactory</implementation>
+    </component>
+    <component>
+      <role>org.apache.maven.plugins.release.phase.ReleasePhase</role>
+      <role-hint>end-release</role-hint>
+      <implementation>org.apache.maven.plugins.release.phase.EndReleasePhase</implementation>
     </component>
   </components>
 </component-set>

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/config/ReleaseConfigurationStoreStub.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/config/ReleaseConfigurationStoreStub.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/config/ReleaseConfigurationStoreStub.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/config/ReleaseConfigurationStoreStub.java
Tue May  2 20:09:44 2006
@@ -40,6 +40,10 @@
         this.releaseConfiguration = config;
     }
 
+    public void delete( ReleaseConfiguration config )
+    {
+    }
+
     public ReleaseConfiguration getReleaseConfiguration()
     {
         return releaseConfiguration;

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java?rev=399113&r1=399112&r2=399113&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java
Tue May  2 20:09:44 2006
@@ -41,6 +41,11 @@
      */
     private String name;
 
+    /**
+     * Whether the phase was cleaned.
+     */
+    private boolean cleaned;
+
     public void execute( ReleaseConfiguration releaseConfiguration )
     {
         executed = true;
@@ -51,6 +56,11 @@
         simulated = true;
     }
 
+    public void clean( ReleaseConfiguration config )
+    {
+        cleaned = true;
+    }
+
     public boolean isExecuted()
     {
         return executed;
@@ -59,5 +69,10 @@
     public boolean isSimulated()
     {
         return simulated;
+    }
+
+    public boolean isCleaned()
+    {
+        return cleaned;
     }
 }



Mime
View raw message