maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r399197 - in /maven/plugins/trunk/maven-release-plugin/src: main/java/org/apache/maven/plugins/release/phase/AbstractRewritePomsPhase.java test/java/org/apache/maven/plugins/release/phase/AbstractRewritingReleasePhaseTestCase.java
Date Wed, 03 May 2006 08:07:11 GMT
Author: brett
Date: Wed May  3 01:07:10 2006
New Revision: 399197

URL: http://svn.apache.org/viewcvs?rev=399197&view=rev
Log:
[MRELEASE-98] avoid NPE when running project-less

Modified:
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/phase/AbstractRewritePomsPhase.java
    maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractRewritingReleasePhaseTestCase.java

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=399197&r1=399196&r2=399197&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
Wed May  3 01:07:10 2006
@@ -491,14 +491,18 @@
     {
         super.clean( config );
 
-        for ( Iterator i = config.getReactorProjects().iterator(); i.hasNext(); )
+        if ( config.getReactorProjects() != null )
         {
-            MavenProject project = (MavenProject) i.next();
-
-            File file = new File( project.getFile().getParentFile(), project.getFile().getName()
+ "." + pomSuffix );
-            if ( file.exists() )
+            for ( Iterator i = config.getReactorProjects().iterator(); i.hasNext(); )
             {
-                file.delete();
+                MavenProject project = (MavenProject) i.next();
+
+                File file =
+                    new File( project.getFile().getParentFile(), project.getFile().getName()
+ "." + pomSuffix );
+                if ( file.exists() )
+                {
+                    file.delete();
+                }
             }
         }
     }

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractRewritingReleasePhaseTestCase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractRewritingReleasePhaseTestCase.java?rev=399197&r1=399196&r2=399197&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractRewritingReleasePhaseTestCase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractRewritingReleasePhaseTestCase.java
Wed May  3 01:07:10 2006
@@ -526,6 +526,19 @@
         }
     }
 
+    public void testCleanNoProjects()
+        throws Exception
+    {
+        // This occurs when it is release:perform run standalone. Just check there are no
errors.
+        ReleaseConfiguration config = new ReleaseConfiguration();
+        config.setUrl( "scm:svn:file://localhost/tmp/scm-repo" );
+        config.setWorkingDirectory( getTestFile( "target/test/checkout" ) );
+
+        phase.clean( config );
+
+        assertTrue( true );
+    }
+
     private ReleaseConfiguration createUnmappedConfiguration( String path )
         throws Exception
     {



Mime
View raw message