maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r566134 - in /maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/resolver: DefaultArtifactResolver.java MultipleArtifactsNotFoundException.java
Date Wed, 15 Aug 2007 12:54:19 GMT
Author: carlos
Date: Wed Aug 15 05:54:19 2007
New Revision: 566134

URL: http://svn.apache.org/viewvc?view=rev&rev=566134
Log:
Add resolved artifacts to MutipleArtifactsNotFoundException

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

Modified: maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java?view=diff&rev=566134&r1=566133&r2=566134
==============================================================================
--- maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
(original)
+++ maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
Wed Aug 15 05:54:19 2007
@@ -285,6 +285,7 @@
                                                               localRepository, remoteRepositories,
source, filter,
                                                               listeners );
 
+        List resolvedArtifacts = new ArrayList();
         List missingArtifacts = new ArrayList();
         for ( Iterator i = artifactResolutionResult.getArtifactResolutionNodes().iterator();
i.hasNext(); )
         {
@@ -292,6 +293,7 @@
             try
             {
                 resolve( node.getArtifact(), node.getRemoteRepositories(), localRepository
);
+                resolvedArtifacts.add( node.getArtifact() );
             }
             catch ( ArtifactNotFoundException anfe )
             {
@@ -303,7 +305,8 @@
 
         if ( missingArtifacts.size() > 0 )
         {
-            throw new MultipleArtifactsNotFoundException( originatingArtifact, missingArtifacts,
remoteRepositories );
+            throw new MultipleArtifactsNotFoundException( originatingArtifact, resolvedArtifacts,
missingArtifacts,
+                                                          remoteRepositories );
         }
 
         return artifactResolutionResult;

Modified: maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/MultipleArtifactsNotFoundException.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/MultipleArtifactsNotFoundException.java?view=diff&rev=566134&r1=566133&r2=566134
==============================================================================
--- maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/MultipleArtifactsNotFoundException.java
(original)
+++ maven/components/trunk/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/MultipleArtifactsNotFoundException.java
Wed Aug 15 05:54:19 2007
@@ -19,22 +19,59 @@
  * under the License.
  */
 
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
 import org.apache.maven.artifact.Artifact;
 
+/**
+ * Exception caused when one or more artifacts can not be resolved because they are not found
in the
+ * local or remote repositories.
+ */
 public class MultipleArtifactsNotFoundException
     extends ArtifactResolutionException
 {
+    private final List resolvedArtifacts;
     private final List missingArtifacts;
     
-    public MultipleArtifactsNotFoundException( Artifact originatingArtifact, List artifacts,
List remoteRepositories )
+    /**
+     * @deprecated use {@link #MultipleArtifactsNotFoundException(Artifact, List, List, List)}

+     */
+    public MultipleArtifactsNotFoundException( Artifact originatingArtifact, List missingArtifacts,
List remoteRepositories )
     {
-        super( constructMessage( artifacts ), originatingArtifact, remoteRepositories );
-        this.missingArtifacts = artifacts;
+        this( originatingArtifact, new ArrayList(), missingArtifacts, remoteRepositories
);
+    }
+
+    /**
+     * Create an instance of the exception with allrequired information.
+     * 
+     * @param originatingArtifact the artifact that was being resolved
+     * @param resolvedArtifacts artifacts that could be resolved
+     * @param missingArtifacts artifacts that could not be resolved
+     * @param remoteRepositories remote repositories where the missing artifacts were not
found
+     */
+    public MultipleArtifactsNotFoundException( Artifact originatingArtifact, List resolvedArtifacts,
+                                               List missingArtifacts, List remoteRepositories
)
+    {
+        super( constructMessage( missingArtifacts ), originatingArtifact, remoteRepositories
);
+        this.resolvedArtifacts = resolvedArtifacts;
+        this.missingArtifacts = missingArtifacts;
+    }
+
+    /**
+     * artifacts that could be resolved
+     * @return {@link List} of {@link Artifact}
+     */
+    public List getResolvedArtifacts()
+    {
+        return resolvedArtifacts;
     }
     
+    /**
+     * artifacts that could NOT be resolved
+     * @return {@link List} of {@link Artifact}
+     */
     public List getMissingArtifacts()
     {
         return missingArtifacts;



Mime
View raw message