maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aherit...@apache.org
Subject svn commit: r721005 - /maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhase.java
Date Wed, 26 Nov 2008 22:22:32 GMT
Author: aheritier
Date: Wed Nov 26 14:22:32 2008
New Revision: 721005

URL: http://svn.apache.org/viewvc?rev=721005&view=rev
Log:
Regression: NullPointerException at end of standalone "release:perform" 
http://jira.codehaus.org/browse/MRELEASE-273

Modified:
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhase.java

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhase.java?rev=721005&r1=721004&r2=721005&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhase.java
Wed Nov 26 14:22:32 2008
@@ -19,6 +19,10 @@
  * under the License.
  */
 
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.shared.release.ReleaseExecutionException;
 import org.apache.maven.shared.release.ReleaseFailureException;
@@ -28,10 +32,6 @@
 import org.apache.maven.shared.release.util.ReleaseUtil;
 import org.codehaus.plexus.util.FileUtils;
 
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-
 /**
  * @author Edwin Punzalan
  * @plexus.component role="org.apache.maven.shared.release.phase.ReleasePhase" role-hint="create-backup-poms"
@@ -39,12 +39,13 @@
 public class CreateBackupPomsPhase
     extends AbstractBackupPomsPhase
 {
-    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment
releaseEnvironment, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment
releaseEnvironment,
+                                  List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         ReleaseResult result = new ReleaseResult();
 
-        //remove previous backups, if any
+        // remove previous backups, if any
         clean( reactorProjects );
 
         for ( Iterator projects = reactorProjects.iterator(); projects.hasNext(); )
@@ -67,7 +68,9 @@
         {
             MavenProject project = (MavenProject) projects.next();
 
-            deletePomBackup( project );
+            if ( project.getFile() != null )
+                // MRELEASE-273 : don't cleanup if there's no pom
+                deletePomBackup( project );
         }
 
         result.setResultCode( ReleaseResult.SUCCESS );
@@ -75,7 +78,8 @@
         return result;
     }
 
-    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment
releaseEnvironment, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment
releaseEnvironment,
+                                   List reactorProjects )
         throws ReleaseExecutionException, ReleaseFailureException
     {
         return execute( releaseDescriptor, releaseEnvironment, reactorProjects );
@@ -84,7 +88,7 @@
     private void createPomBackup( MavenProject project )
         throws ReleaseExecutionException
     {
-        //delete any existing backup first
+        // delete any existing backup first
         deletePomBackup( project );
 
         try



Mime
View raw message