maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r812993 - /maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
Date Wed, 09 Sep 2009 15:26:04 GMT
Author: bentmann
Date: Wed Sep  9 15:26:04 2009
New Revision: 812993

URL: http://svn.apache.org/viewvc?rev=812993&view=rev
Log:
[MNG-4349] [regression] Maven hangs in endless loop if POM of relocated artifact is invalid

Modified:
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java?rev=812993&r1=812992&r2=812993&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
(original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
Wed Sep  9 15:26:04 2009
@@ -162,6 +162,8 @@
 
             pomArtifact = rel.pomArtifact;
 
+            relocatedArtifact = rel.relocatedArtifact;
+
             if ( rel.project == null )
             {
                 // When this happens we have a Maven 1.x POM, or some invalid POM. There
is still a pile of
@@ -171,8 +173,6 @@
             }
             else
             {
-                relocatedArtifact = rel.relocatedArtifact;
-
                 dependencies = rel.project.getDependencies();
 
                 DependencyManagement depMngt = rel.project.getDependencyManagement();
@@ -454,13 +454,15 @@
     private ProjectRelocation retrieveRelocatedProject( Artifact artifact, RepositoryRequest
repositoryRequest )
         throws ArtifactMetadataRetrievalException
     {
-        MavenProject project = null;
+        MavenProject project;
 
         Artifact pomArtifact;
         Artifact relocatedArtifact = artifact;
         boolean done = false;
         do
         {
+            project = null;
+
             pomArtifact =
                 repositorySystem.createProjectArtifact( relocatedArtifact.getGroupId(),
                                                         relocatedArtifact.getArtifactId(),
@@ -497,11 +499,11 @@
                     // missing/incompatible POM (e.g. a Maven 1 POM)
                     if ( e.getCause() instanceof ArtifactResolutionException )
                     {
-                        message = "Missing artifact metadata for " + artifact.getId();
+                        message = "Missing artifact metadata for " + relocatedArtifact.getId();
                     }
                     else
                     {
-                        message = "Invalid artifact metadata for " + artifact.getId();
+                        message = "Invalid artifact metadata for " + relocatedArtifact.getId();
                     }
 
                     if ( logger.isDebugEnabled() )



Mime
View raw message