Author: brett
Date: Thu Jun  2 01:15:52 2005
New Revision: 179556

URL: http://svn.apache.org/viewcvs?rev=179556&view=rev
Log:
don't resolve an artifact more than once.
This could be done better as part of the session instead of a static, but it 
does the job for now.

Modified:
    
maven/maven-1/core/trunk/src/java/org/apache/maven/verifier/DependencyVerifier.java

Modified: 
maven/maven-1/core/trunk/src/java/org/apache/maven/verifier/DependencyVerifier.java
URL: 
http://svn.apache.org/viewcvs/maven/maven-1/core/trunk/src/java/org/apache/maven/verifier/DependencyVerifier.java?rev=179556&r1=179555&r2=179556&view=diff
==============================================================================
--- 
maven/maven-1/core/trunk/src/java/org/apache/maven/verifier/DependencyVerifier.java
 (original)
+++ 
maven/maven-1/core/trunk/src/java/org/apache/maven/verifier/DependencyVerifier.java
 Thu Jun  2 01:15:52 2005
@@ -40,6 +40,9 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.HashSet;
 
 /**
  * Make sure that everything that is required for the project to build
@@ -53,11 +56,6 @@
  * @todo Separate out the local settings verifier because this only needs to 
be run
  *       once a session, but is currently being run during project 
verification so
  *       this is a big waste in the reactor for example.
- * @todo For a given maven session keep track of what snapshots have been 
downloaded
- *       so that we can prevent the same snapshots retrieval attempts from 
happening
- *       repeatedly. I think we can assume in a single session the snapshot 
won't
- *       change. This would certainly help is large reactor builds like the 
jelly
- *       tags where all of them depend on a jelly snapshot.
  */
 public class DependencyVerifier
     extends AbstractMavenComponent
@@ -71,6 +69,8 @@
     /** Local Repository verifier. */
     private LocalSettingsVerifier localRepositoryVerifier;
 
+    private static Set resolvedArtifacts = new HashSet();
+
     /**
      * Default ctor.
      * @param project the project to verify
@@ -137,6 +137,14 @@
         for ( Iterator i = getProject().getArtifacts().iterator(); 
i.hasNext();)
         {
             Artifact artifact = (Artifact) i.next();
+
+            String path = artifact.getPath();
+            if ( resolvedArtifacts.contains( path ) )
+            {
+                log.debug( "(previously resolved: " + path + ")" );
+                continue;
+            }
+            resolvedArtifacts.add( path );
 
             // The artifact plain doesn't exist so chalk it up as a failed 
dependency.
             if ( !artifact.exists() )



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to