re-fixing MNG-3974

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@748688 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brian E Fox 2009-02-27 20:43:58 +00:00
parent f5771c7dfb
commit d8b2bb7b3c
2 changed files with 10 additions and 2 deletions

View File

@ -42,7 +42,13 @@ public class DefaultMirrorBuilder
ArtifactRepository mirror = new DefaultArtifactRepository( id, url, null );
mirrors.put( mirrorOf, mirror );
//System.out.println( mirror + " --> " + mirrorOf );
//first one must win so don't insert more.
if (!mirrors.containsKey( mirrorOf ))
{
mirrors.put( mirrorOf, mirror );
}
}
/**
@ -67,6 +73,8 @@ public class DefaultMirrorBuilder
if ( matchPattern( originalRepository, pattern ) )
{
selectedMirror = mirrors.get( pattern );
//stop on the first match.
break;
}
}
}

View File

@ -79,7 +79,7 @@ public class MirrorProcessorTest
}
public void xtestMirrorStopOnFirstMatch()
public void testMirrorStopOnFirstMatch()
{
//exact matches win first
mirrorBuilder.addMirror( "a2", "a,b", "http://a2" );