You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2005/10/27 06:00:21 UTC

svn commit: r328782 - /maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java

Author: jvanzyl
Date: Wed Oct 26 21:00:18 2005
New Revision: 328782

URL: http://svn.apache.org/viewcvs?rev=328782&view=rev
Log:
o the artifact resolver should continue with the next artifact in the
  resolution group even after it could not find one, and throw an exception at
  the end that lists all the artifacts that could not be found.

  http://jira.codehaus.org/browse/MNG-1198


Modified:
    maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java

Modified: maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java?rev=328782&r1=328781&r2=328782&view=diff
==============================================================================
--- maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java (original)
+++ maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java Wed Oct 26 21:00:18 2005
@@ -224,10 +224,31 @@
                                                               localRepository, remoteRepositories, source, filter,
                                                               listeners );
 
+        List missingArtifacts = new ArrayList();
         for ( Iterator i = artifactResolutionResult.getArtifactResolutionNodes().iterator(); i.hasNext(); )
         {
             ResolutionNode node = (ResolutionNode) i.next();
-            resolve( node.getArtifact(), node.getRemoteRepositories(), localRepository );
+            try
+            {
+                resolve( node.getArtifact(), node.getRemoteRepositories(), localRepository );
+            }
+            catch ( ArtifactNotFoundException anfe )
+            {
+                getLogger().debug( anfe.getMessage() );
+                missingArtifacts.add( node.getArtifact() );
+            }
+        }
+        
+        if ( missingArtifacts.size() > 0 )
+        {
+            String message = "required artifacts missing:\n";
+            for( Iterator i=missingArtifacts.iterator(); i.hasNext(); )
+            {
+                Artifact missingArtifact = (Artifact) i.next();
+                message += "  " + missingArtifact.getId() + "\n";
+            }
+            message += "\nfor the artifact:";
+            throw new ArtifactResolutionException( message, originatingArtifact, remoteRepositories );
         }
 
         return artifactResolutionResult;



Re: svn commit: r328782 - /maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java

Posted by Jason van Zyl <ja...@maven.org>.
On Thu, 2005-10-27 at 17:12 -0700, Brett Porter wrote:
> You should actually edit the commit message for the record.
> 
> svn propedit --revprop -r328782 svn:log

Will do.

> Cheers,
> Brett
> 
> Jason van Zyl wrote:
> > On Thu, 2005-10-27 at 04:00 +0000, jvanzyl@apache.org wrote:
> > 
> >>Author: jvanzyl
> >>Date: Wed Oct 26 21:00:18 2005
> >>New Revision: 328782
> >>
> >>URL: http://svn.apache.org/viewcvs?rev=328782&view=rev
> >>Log:
> >>o the artifact resolver should continue with the next artifact in the
> >>  resolution group even after it could not find one, and throw an exception at
> >>  the end that lists all the artifacts that could not be found.
> >>
> >>  http://jira.codehaus.org/browse/MNG-1198
> >>
> > 
> > 
> > Forgot to thank Edwin for that patch. Sorry about that.
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org

A party which is not afraid of letting culture,
business, and welfare go to ruin completely can
be omnipotent for a while.

  -- Jakob Burckhardt


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r328782 - /maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java

Posted by Brett Porter <br...@apache.org>.
You should actually edit the commit message for the record.

svn propedit --revprop -r328782 svn:log

Cheers,
Brett

Jason van Zyl wrote:
> On Thu, 2005-10-27 at 04:00 +0000, jvanzyl@apache.org wrote:
> 
>>Author: jvanzyl
>>Date: Wed Oct 26 21:00:18 2005
>>New Revision: 328782
>>
>>URL: http://svn.apache.org/viewcvs?rev=328782&view=rev
>>Log:
>>o the artifact resolver should continue with the next artifact in the
>>  resolution group even after it could not find one, and throw an exception at
>>  the end that lists all the artifacts that could not be found.
>>
>>  http://jira.codehaus.org/browse/MNG-1198
>>
> 
> 
> Forgot to thank Edwin for that patch. Sorry about that.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r328782 - /maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java

Posted by Jason van Zyl <ja...@maven.org>.
On Thu, 2005-10-27 at 04:00 +0000, jvanzyl@apache.org wrote:
> Author: jvanzyl
> Date: Wed Oct 26 21:00:18 2005
> New Revision: 328782
> 
> URL: http://svn.apache.org/viewcvs?rev=328782&view=rev
> Log:
> o the artifact resolver should continue with the next artifact in the
>   resolution group even after it could not find one, and throw an exception at
>   the end that lists all the artifacts that could not be found.
> 
>   http://jira.codehaus.org/browse/MNG-1198
> 

Forgot to thank Edwin for that patch. Sorry about that.

-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org

Our achievements speak for themselves. What we have to keep track
of are our failures, discouragements and doubts. We tend to forget
the past difficulties, the many false starts, and the painful
groping. We see our past achievements as the end result of a
clean forward thrust, and our present difficulties as
signs of decline and decay.

 -- Eric Hoffer, Reflections on the Human Condition


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org