mirror of https://github.com/apache/maven.git
MNG-3974 - stop on first mirror pattern match (fix to handle repeated entires)
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@733071 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6034e26622
commit
9c7e082906
|
@ -1109,8 +1109,12 @@ public class DefaultWagonManager
|
||||||
|
|
||||||
ArtifactRepository mirror = new DefaultArtifactRepository( id, url, null );
|
ArtifactRepository mirror = new DefaultArtifactRepository( id, url, null );
|
||||||
|
|
||||||
|
//to preserve first wins, don't add repeated mirrors.
|
||||||
|
if (!mirrors.containsKey( mirrorOf ))
|
||||||
|
{
|
||||||
mirrors.put( mirrorOf, mirror );
|
mirrors.put( mirrorOf, mirror );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setOnline( boolean online )
|
public void setOnline( boolean online )
|
||||||
{
|
{
|
||||||
|
|
|
@ -585,6 +585,8 @@ public class DefaultWagonManagerTest
|
||||||
//exact matches win first
|
//exact matches win first
|
||||||
wagonManager.addMirror( "a2", "a,b", "http://a2" );
|
wagonManager.addMirror( "a2", "a,b", "http://a2" );
|
||||||
wagonManager.addMirror( "a", "a", "http://a" );
|
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( "b", "b", "http://b" );
|
||||||
wagonManager.addMirror( "c", "d,e", "http://de" );
|
wagonManager.addMirror( "c", "d,e", "http://de" );
|
||||||
|
|
Loading…
Reference in New Issue