maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aherit...@apache.org
Subject svn commit: r721030 - in /maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release: phase/CreateBackupPomsPhase.java util/ReleaseUtil.java
Date Wed, 26 Nov 2008 23:17:59 GMT
Author: aheritier
Date: Wed Nov 26 15:17:58 2008
New Revision: 721030

URL: http://svn.apache.org/viewvc?rev=721030&view=rev
Log:
MRELEASE-273: 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
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.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=721030&r1=721029&r2=721030&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 15:17:58 2008
@@ -68,9 +68,7 @@
         {
             MavenProject project = (MavenProject) projects.next();
 
-            if ( project.getFile() != null )
-                // MRELEASE-273 : don't cleanup if there's no pom
-                deletePomBackup( project );
+            deletePomBackup( project );
         }
 
         result.setResultCode( ReleaseResult.SUCCESS );

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java?rev=721030&r1=721029&r2=721030&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
Wed Nov 26 15:17:58 2008
@@ -19,16 +19,16 @@
  * under the License.
  */
 
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.ReaderFactory;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.Reader;
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.ReaderFactory;
+
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -69,7 +69,8 @@
         File pom = project.getFile();
         File releasePom = getReleasePom( project );
 
-        if ( pom.equals( releasePom ))
+        // MRELEASE-273 : pom can be null here
+        if ( pom != null && pom.equals( releasePom ) )
         {
             pom = new File( pom.getParent(), POMv4 );
         }
@@ -86,7 +87,7 @@
      * Gets the string contents of the specified XML file. Note: In contrast to an XML processor,
the line separators in
      * the returned string will be normalized to use the platform's native line separator.
This is basically to save
      * another normalization step when writing the string contents back to an XML file.
-     *
+     * 
      * @param file The path to the XML file to read in, must not be <code>null</code>.
      * @return The string contents of the XML file.
      * @throws IOException If the file could not be opened/read.
@@ -108,12 +109,12 @@
 
     /**
      * Normalizes the line separators in the specified string.
-     *
+     * 
      * @param text The string to normalize, may be <code>null</code>.
      * @param separator The line separator to use for normalization, typically "\n" or "\r\n",
must not be
      *            <code>null</code>.
-     * @return The input string with normalized line separators or <code>null</code>
if the string was
-     *         <code>null</code>.
+     * @return The input string with normalized line separators or <code>null</code>
if the string was <code>null</code>
+     *         .
      */
     public static String normalizeLineEndings( String text, String separator )
     {



Mime
View raw message