maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r733071 - in /maven/components/trunk/maven-compat/src: main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java test/java/org/apache/maven/artifact/manager/DefaultWagonManagerTest.java
Date Fri, 09 Jan 2009 15:50:31 GMT
Author: brianf
Date: Fri Jan  9 07:50:31 2009
New Revision: 733071

URL: http://svn.apache.org/viewvc?rev=733071&view=rev
Log:
MNG-3974 - stop on first mirror pattern match (fix to handle repeated entires)

Modified:
    maven/components/trunk/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
    maven/components/trunk/maven-compat/src/test/java/org/apache/maven/artifact/manager/DefaultWagonManagerTest.java

Modified: maven/components/trunk/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java?rev=733071&r1=733070&r2=733071&view=diff
==============================================================================
--- maven/components/trunk/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
(original)
+++ maven/components/trunk/maven-compat/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
Fri Jan  9 07:50:31 2009
@@ -1109,7 +1109,11 @@
         
         ArtifactRepository mirror = new DefaultArtifactRepository( id, url, null );
 
-        mirrors.put( mirrorOf, mirror );
+        //to preserve first wins, don't add repeated mirrors.
+        if (!mirrors.containsKey( mirrorOf ))
+        {
+            mirrors.put( mirrorOf, mirror );
+        }
     }
 
     public void setOnline( boolean online )

Modified: maven/components/trunk/maven-compat/src/test/java/org/apache/maven/artifact/manager/DefaultWagonManagerTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-compat/src/test/java/org/apache/maven/artifact/manager/DefaultWagonManagerTest.java?rev=733071&r1=733070&r2=733071&view=diff
==============================================================================
--- maven/components/trunk/maven-compat/src/test/java/org/apache/maven/artifact/manager/DefaultWagonManagerTest.java
(original)
+++ maven/components/trunk/maven-compat/src/test/java/org/apache/maven/artifact/manager/DefaultWagonManagerTest.java
Fri Jan  9 07:50:31 2009
@@ -585,6 +585,8 @@
         //exact matches win first
         wagonManager.addMirror( "a2", "a,b", "http://a2" );
         wagonManager.addMirror( "a", "a", "http://a" );
+        //make sure repeated entries are skipped
+        wagonManager.addMirror( "a", "a", "http://a3" );
         
         wagonManager.addMirror( "b", "b", "http://b" );
         wagonManager.addMirror( "c", "d,e", "http://de" );



Mime
View raw message