本文整理了Java中org.apache.maven.settings.Settings.getMirrors()
方法的一些代码示例,展示了Settings.getMirrors()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Settings.getMirrors()
方法的具体详情如下:
包路径:org.apache.maven.settings.Settings
类名称:Settings
方法名:getMirrors
[英]Method getMirrors.
[中]方法获取镜像。
代码示例来源:origin: apache/maven
/**
* Method removeMirror.
*
* @param mirror
*/
public void removeMirror( Mirror mirror )
{
getMirrors().remove( mirror );
} //-- void removeMirror( Mirror )
代码示例来源:origin: apache/maven
/**
* Method addMirror.
*
* @param mirror
*/
public void addMirror( Mirror mirror )
{
getMirrors().add( mirror );
} //-- void addMirror( Mirror )
代码示例来源:origin: apache/maven
@Deprecated
public Mirror getMirrorOf( String repositoryId )
{
Mirror match = null;
java.util.List<Mirror> mirrors = getMirrors();
if ( mirrors != null && repositoryId != null )
{
for ( Mirror mirror : mirrors )
{
if ( repositoryId.equals( mirror.getMirrorOf() ) )
{
match = mirror;
break;
}
}
}
return match;
}
代码示例来源:origin: apache/maven
shallowMergeById( dominant.getMirrors(), recessive.getMirrors(), recessiveSourceLevel );
shallowMergeById( dominant.getServers(), recessive.getServers(), recessiveSourceLevel );
shallowMergeById( dominant.getProxies(), recessive.getProxies(), recessiveSourceLevel );
代码示例来源:origin: apache/maven
@Deprecated
public ArtifactRepository getMirrorRepository( ArtifactRepository repository )
{
Mirror mirror = mirrorSelector.getMirror( repository, legacySupport.getSession().getSettings().getMirrors() );
if ( mirror != null )
{
String id = mirror.getId();
if ( id == null )
{
// TODO this should be illegal in settings.xml
id = repository.getId();
}
log.debug( "Using mirror: " + mirror.getUrl() + " (id: " + id + ")" );
repository = artifactRepositoryFactory.createArtifactRepository( id, mirror.getUrl(),
repository.getLayout(), repository.getSnapshots(),
repository.getReleases() );
}
return repository;
}
代码示例来源:origin: apache/maven
if ( ( settings.getMirrors() != null ) && ( settings.getMirrors().size() > 0 ) )
for ( Iterator iter = settings.getMirrors().iterator(); iter.hasNext(); )
代码示例来源:origin: apache/maven
List<Mirror> mirrors = settings.getMirrors();
代码示例来源:origin: org.apache.maven/maven-settings
/**
* Method addMirror.
*
* @param mirror
*/
public void addMirror( Mirror mirror )
{
getMirrors().add( mirror );
} //-- void addMirror( Mirror )
代码示例来源:origin: org.apache.maven/maven-settings
/**
* Method removeMirror.
*
* @param mirror
*/
public void removeMirror( Mirror mirror )
{
getMirrors().remove( mirror );
} //-- void removeMirror( Mirror )
代码示例来源:origin: org.apache.maven/maven-settings
@Deprecated
public Mirror getMirrorOf( String repositoryId )
{
Mirror match = null;
java.util.List<Mirror> mirrors = getMirrors();
if ( mirrors != null && repositoryId != null )
{
for ( Mirror mirror : mirrors )
{
if ( repositoryId.equals( mirror.getMirrorOf() ) )
{
match = mirror;
break;
}
}
}
return match;
}
代码示例来源:origin: apache/maven
for ( Mirror mirror : settings.getMirrors() )
代码示例来源:origin: apache/maven
/**
* @param settings could be null
* @return a new instance of settings or null if settings was null.
*/
public static Settings copySettings( Settings settings )
{
if ( settings == null )
{
return null;
}
Settings clone = new Settings();
clone.setActiveProfiles( settings.getActiveProfiles() );
clone.setInteractiveMode( settings.isInteractiveMode() );
clone.setLocalRepository( settings.getLocalRepository() );
clone.setMirrors( settings.getMirrors() );
clone.setModelEncoding( settings.getModelEncoding() );
clone.setOffline( settings.isOffline() );
clone.setPluginGroups( settings.getPluginGroups() );
clone.setProfiles( settings.getProfiles() );
clone.setProxies( settings.getProxies() );
clone.setServers( settings.getServers() );
clone.setSourceLevel( settings.getSourceLevel() );
clone.setUsePluginRegistry( settings.isUsePluginRegistry() );
return clone;
}
}
代码示例来源:origin: apache/maven
for ( Mirror mirror : settings.getMirrors() )
代码示例来源:origin: org.apache.maven/maven-settings
if ( ( settings.getMirrors() != null ) && ( settings.getMirrors().size() > 0 ) )
for ( Iterator iter = settings.getMirrors().iterator(); iter.hasNext(); )
代码示例来源:origin: org.jboss.forge.furnace/furnace-manager-resolver-maven
static Optional<String> getCentralMirrorURL(Settings settings)
{
return settings.getMirrors().stream()
.filter(m -> "central".equals(m.getMirrorOf()) ||
"*".equals(m.getMirrorOf()) ||
MAVEN_CENTRAL_REPO.equals(m.getMirrorOf()))
.map(Mirror::getUrl)
.findFirst();
}
代码示例来源:origin: spring-cloud/spring-cloud-function
private MirrorSelector createMirrorSelector(Settings settings) {
DefaultMirrorSelector selector = new DefaultMirrorSelector();
for (Mirror mirror : settings.getMirrors()) {
selector.add(mirror.getId(), mirror.getUrl(), mirror.getLayout(), false,
mirror.getMirrorOf(), mirror.getMirrorOfLayouts());
}
return selector;
}
代码示例来源:origin: org.kie.soup/kie-soup-maven-integration
public RemoteRepository resolveMirroredRepo( RemoteRepository repo ) {
for ( Mirror mirror : settings.getMirrors() ) {
if ( isMirror( repo, mirror.getMirrorOf() ) ) {
return toRemoteRepositoryBuilder( settings,
mirror.getId(),
mirror.getLayout(),
mirror.getUrl() ).build();
}
}
return repo;
}
代码示例来源:origin: org.springframework.boot/spring-boot-cli
private MirrorSelector createMirrorSelector(Settings settings) {
DefaultMirrorSelector selector = new DefaultMirrorSelector();
for (Mirror mirror : settings.getMirrors()) {
selector.add(mirror.getId(), mirror.getUrl(), mirror.getLayout(), false,
mirror.getMirrorOf(), mirror.getMirrorOfLayouts());
}
return selector;
}
代码示例来源:origin: org.uberfire/uberfire-maven-integration
public RemoteRepository resolveMirroredRepo( RemoteRepository repo ) {
for ( Mirror mirror : settings.getMirrors() ) {
if ( isMirror( repo, mirror.getMirrorOf() ) ) {
return toRemoteRepositoryBuilder( settings,
mirror.getId(),
mirror.getLayout(),
mirror.getUrl() ).build();
}
}
return repo;
}
代码示例来源:origin: io.fabric8/fabric-maven
private MirrorSelector selectMirrors( Mirror mirror ) {
// configure mirror
DefaultMirrorSelector selector = new DefaultMirrorSelector();
for( Mirror m : m_settings.getMirrors() ) {
selector.add( m.getName(), m.getUrl(), null, false, m.getMirrorOf(), "*" );
}
if( mirror != null ) {
selector.add(mirror.getName(), mirror.getUrl(), null, false, mirror.getMirrorOf(), "*");
}
return selector;
}
内容来源于网络,如有侵权,请联系作者删除!