org.apache.maven.settings.Settings.getServers()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中org.apache.maven.settings.Settings.getServers()方法的一些代码示例,展示了Settings.getServers()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Settings.getServers()方法的具体详情如下:
包路径:org.apache.maven.settings.Settings
类名称:Settings
方法名:getServers

Settings.getServers介绍

[英]Method getServers.
[中]方法获取服务器。

代码示例

代码示例来源:origin: apache/maven

/**
 * Method addServer.
 * 
 * @param server
 */
public void addServer( Server server )
{
  getServers().add( server );
} //-- void addServer( Server )

代码示例来源:origin: apache/maven

/**
 * Method removeServer.
 * 
 * @param server
 */
public void removeServer( Server server )
{
  getServers().remove( server );
} //-- void removeServer( Server )

代码示例来源:origin: apache/maven

public Server getServer( String serverId )
{
  Server match = null;
  java.util.List<Server> servers = getServers();
  if ( servers != null && serverId != null )
  {
    for ( Server server : servers )
    {
      if ( serverId.equals( server.getId() ) )
      {
        match = server;
        break;
      }
    }
  }
  return match;
}

代码示例来源:origin: spotify/dockerfile-maven

@Override
public RegistryConfigs authForBuild() throws DockerException {
 final Map<String, RegistryAuth> allConfigs = new HashMap<>();
 for (Server server : settings.getServers()) {
  allConfigs.put(server.getId(), createRegistryAuth(server));
 }
 return RegistryConfigs.create(allConfigs);
}

代码示例来源:origin: apache/maven

/**
 * Creates a new request to decrypt the specified settings.
 *
 * @param settings The settings to decrypt, must not be {@code null}.
 */
public DefaultSettingsDecryptionRequest( Settings settings )
{
  setServers( settings.getServers() );
  setProxies( settings.getProxies() );
}

代码示例来源:origin: fabric8io/docker-maven-plugin

private AuthConfig getAuthConfigFromSettings(Settings settings, String user, String registry) throws MojoExecutionException {
  Server defaultServer = null;
  Server found;
  for (Server server : settings.getServers()) {
    String id = server.getId();
    // Remember a default server without user as fallback for later
    if (defaultServer == null) {
      defaultServer = checkForServer(server, id, registry, null);
    }
    // Check for specific server with user part
    found = checkForServer(server, id, registry, user);
    if (found != null) {
      return createAuthConfigFromServer(found);
    }
  }
  return defaultServer != null ? createAuthConfigFromServer(defaultServer) : null;
}

代码示例来源:origin: apache/maven

shallowMergeById( dominant.getServers(), recessive.getServers(), recessiveSourceLevel );
shallowMergeById( dominant.getProxies(), recessive.getProxies(), recessiveSourceLevel );
shallowMergeById( dominant.getProfiles(), recessive.getProfiles(), recessiveSourceLevel );

代码示例来源:origin: apache/maven

if ( ( settings.getServers() != null ) && ( settings.getServers().size() > 0 ) )
  for ( Iterator iter = settings.getServers().iterator(); iter.hasNext(); )

代码示例来源:origin: org.apache.maven/maven-settings

/**
 * Method addServer.
 * 
 * @param server
 */
public void addServer( Server server )
{
  getServers().add( server );
} //-- void addServer( Server )

代码示例来源:origin: apache/maven

List<Server> servers = settings.getServers();

代码示例来源:origin: org.apache.maven/maven-settings

/**
 * Method removeServer.
 * 
 * @param server
 */
public void removeServer( Server server )
{
  getServers().remove( server );
} //-- void removeServer( Server )

代码示例来源:origin: org.apache.maven/maven-settings

public Server getServer( String serverId )
{
  Server match = null;
  java.util.List<Server> servers = getServers();
  if ( servers != null && serverId != null )
  {
    for ( Server server : servers )
    {
      if ( serverId.equals( server.getId() ) )
      {
        match = server;
        break;
      }
    }
  }
  return match;
}

代码示例来源:origin: apache/maven

for ( Server server : settings.getServers() )

代码示例来源: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 ( Server server : settings.getServers() )

代码示例来源:origin: org.apache.maven/maven-settings

if ( ( settings.getServers() != null ) && ( settings.getServers().size() > 0 ) )
  for ( Iterator iter = settings.getServers().iterator(); iter.hasNext(); )

代码示例来源:origin: org.openmrs.maven.plugins/openmrs-sdk-maven-plugin

public void addServer(Server server) {
    List<Server> servers = settings.getServers();
    servers.add(server);
    settings.setServers(servers);
  }
}

代码示例来源:origin: org.apache.maven/maven-settings-builder

/**
 * Creates a new request to decrypt the specified settings.
 *
 * @param settings The settings to decrypt, must not be {@code null}.
 */
public DefaultSettingsDecryptionRequest( Settings settings )
{
  setServers( settings.getServers() );
  setProxies( settings.getProxies() );
}

代码示例来源:origin: io.tesla.maven/maven-settings-builder

/**
 * Creates a new request to decrypt the specified settings.
 * 
 * @param settings The settings to decrypt, must not be {@code null}.
 */
public DefaultSettingsDecryptionRequest( Settings settings )
{
  setServers( settings.getServers() );
  setProxies( settings.getProxies() );
}

代码示例来源:origin: spring-projects/sts4

private void injectSettings(ArrayList<ArtifactRepository> repositories) throws MavenException {
  Settings settings = getSettings();
  RepositorySystem repositorySystem = lookup(RepositorySystem.class);
  repositorySystem.injectMirror(repositories, getMirrors());
  repositorySystem.injectProxy(repositories, settings.getProxies());
  repositorySystem.injectAuthentication(repositories, settings.getServers());
}

相关文章