mirror of https://github.com/apache/maven.git
o Refactored code
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1073703 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a8ce74df45
commit
40b6533b01
|
@ -461,17 +461,7 @@ public class LegacyRepositorySystem
|
|||
for ( ArtifactRepository repository : repositories )
|
||||
{
|
||||
Mirror mirror = getMirror( repository, mirrors );
|
||||
|
||||
if ( mirror != null )
|
||||
{
|
||||
repository.setId( mirror.getId() );
|
||||
repository.setUrl( mirror.getUrl() );
|
||||
|
||||
if ( StringUtils.isNotEmpty( mirror.getLayout() ) )
|
||||
{
|
||||
repository.setLayout( getLayout( mirror.getLayout() ) );
|
||||
}
|
||||
}
|
||||
injectMirror( repository, mirror );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -504,17 +494,21 @@ public class LegacyRepositorySystem
|
|||
for ( ArtifactRepository repository : repositories )
|
||||
{
|
||||
Mirror mirror = getMirror( session, repository );
|
||||
injectMirror( repository, mirror );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( mirror != null )
|
||||
{
|
||||
repository.setId( mirror.getId() );
|
||||
repository.setUrl( mirror.getUrl() );
|
||||
private void injectMirror( ArtifactRepository repository, Mirror mirror )
|
||||
{
|
||||
if ( mirror != null )
|
||||
{
|
||||
repository.setId( mirror.getId() );
|
||||
repository.setUrl( mirror.getUrl() );
|
||||
|
||||
if ( StringUtils.isNotEmpty( mirror.getLayout() ) )
|
||||
{
|
||||
repository.setLayout( getLayout( mirror.getLayout() ) );
|
||||
}
|
||||
}
|
||||
if ( StringUtils.isNotEmpty( mirror.getLayout() ) )
|
||||
{
|
||||
repository.setLayout( getLayout( mirror.getLayout() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue