maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aherit...@apache.org
Subject svn commit: r721316 - /maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java
Date Thu, 27 Nov 2008 23:44:48 GMT
Author: aheritier
Date: Thu Nov 27 15:44:48 2008
New Revision: 721316

URL: http://svn.apache.org/viewvc?rev=721316&view=rev
Log:
MRELEASE-273: a NPE can hide another

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

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java?rev=721316&r1=721315&r2=721316&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java
Thu Nov 27 15:44:48 2008
@@ -19,6 +19,16 @@
  * under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.model.Build;
@@ -48,16 +58,6 @@
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.WriterFactory;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * Generate release POMs.
  *
@@ -145,6 +145,10 @@
         MavenXpp3Writer pomWriter = new MavenXpp3Writer();
 
         File releasePomFile = ReleaseUtil.getReleasePom( project );
+        
+        // MRELEASE-273 : A release pom can be null
+        if ( releasePomFile == null )
+            throw new ReleaseExecutionException( "Cannot generate release POM : pom file
is null" );
 
         Writer fileWriter = null;
 
@@ -551,7 +555,8 @@
 
             File releasePom = ReleaseUtil.getReleasePom( project );
 
-            if ( releasePom.exists() )
+            // MRELEASE-273 : A release pom can be null
+            if ( releasePom != null && releasePom.exists() )
             {
                 logInfo( result, "Deleting release POM for '" + project.getName() + "'..."
);
 



Mime
View raw message