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

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

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

Settings.setServers介绍

[英]Set configuration of server-specific settings, mainly authentication method. This allows configuration of authentication on a per-server basis.
[中]设置服务器特定设置的配置,主要是身份验证方法。这允许在每台服务器的基础上配置身份验证。

代码示例

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

settings.setServers( servers );
while ( parser.nextTag() == XmlPullParser.START_TAG )

代码示例来源: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: org.apache.maven/maven-settings

settings.setServers( servers );
while ( parser.nextTag() == XmlPullParser.START_TAG )

代码示例来源: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.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven

private Settings decryptPasswords(Settings settings) {
  File securitySettings = new File(DEFAULT_SETTINGS_SECURITY_PATH);
  String altSecuritySettings = SecurityActions.getProperty(ALT_SECURITY_SETTINGS_XML_LOCATION);
  // set alternate file
  if (altSecuritySettings != null && altSecuritySettings.length() > 0) {
    securitySettings = new File(altSecuritySettings);
  }
  SettingsDecrypter decrypter = new MavenSettingsDecrypter(securitySettings);
  SettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest(settings);
  SettingsDecryptionResult result = decrypter.decrypt(request);
  if (result.getProblems().size() > 0) {
    StringBuilder sb = new StringBuilder("Found ").append(result.getProblems().size())
        .append(" problems while trying to decrypt settings configuration.");
    int counter = 1;
    for (SettingsProblem problem : result.getProblems()) {
      sb.append(counter++).append("/ ").append(problem).append("\n");
    }
    throw new InvalidConfigurationFileException(sb.toString());
  }
  settings.setProxies(result.getProxies());
  settings.setServers(result.getServers());
  return settings;
}

代码示例来源:origin: shrinkwrap/resolver

private Settings decryptPasswords(Settings settings) {
  File securitySettings = new File(DEFAULT_SETTINGS_SECURITY_PATH);
  String altSecuritySettings = SecurityActions.getProperty(ALT_SECURITY_SETTINGS_XML_LOCATION);
  // set alternate file
  if (altSecuritySettings != null && altSecuritySettings.length() > 0) {
    securitySettings = new File(altSecuritySettings);
  }
  SettingsDecrypter decrypter = new MavenSettingsDecrypter(securitySettings);
  SettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest(settings);
  SettingsDecryptionResult result = decrypter.decrypt(request);
  if (result.getProblems().size() > 0) {
    StringBuilder sb = new StringBuilder("Found ").append(result.getProblems().size())
        .append(" problems while trying to decrypt settings configuration.");
    int counter = 1;
    for (SettingsProblem problem : result.getProblems()) {
      sb.append(counter++).append("/ ").append(problem).append("\n");
    }
    throw new InvalidConfigurationFileException(sb.toString());
  }
  settings.setProxies(result.getProxies());
  settings.setServers(result.getServers());
  return settings;
}

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

mavenSettings.setServers(newServers);
  mavenSettings.setServers(newServers);

代码示例来源:origin: io.fabric8/fabric-maven

private void decryptSettings()
{
  SettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest( m_settings );
  SettingsDecryptionResult result = decrypter.decrypt( request );
  m_settings.setProxies(result.getProxies());
  m_settings.setServers( result.getServers() );
}

代码示例来源:origin: com.atlassian.confluence.plugin/func-test

effectiveSettings.setServers(decryptionResult.getServers());
effectiveSettings.setProxies(decryptionResult.getProxies());

代码示例来源:origin: com.atlassian.confluence/confluence-stateless-test-runner

effectiveSettings.setServers(decryptionResult.getServers());
effectiveSettings.setProxies(decryptionResult.getProxies());

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

ArrayList<Server> servers = new ArrayList<>();
servers.add(other.getServer("bintray-sdk"));
settings.setServers(servers);

代码示例来源:origin: io.fabric8/maven-util

SettingsDecryptionResult result =
      settingsDecrypter.decrypt(new DefaultSettingsDecryptionRequest(settings));
  settings.setServers(result.getServers());
  settings.setProxies(result.getProxies());
} catch (Exception ex) {

代码示例来源:origin: org.fusesource/maven-util

SettingsDecryptionResult result =
      settingsDecrypter.decrypt(new DefaultSettingsDecryptionRequest(settings));
  settings.setServers(result.getServers());
  settings.setProxies(result.getProxies());
} catch (Exception ex) {

代码示例来源:origin: org.renjin/renjin-aether-package-loader

private static synchronized Settings getSettings() {
 if ( settings == null ) {
  DefaultSettingsBuildingRequest request = new DefaultSettingsBuildingRequest();
  request.setUserSettingsFile(getUserSettings());
  File globalSettings = findGlobalSettings();
  if(globalSettings != null) {
   request.setGlobalSettingsFile(globalSettings);
  }
  try
  {
   settings = settingsBuilder.build( request ).getEffectiveSettings();
  }
  catch ( SettingsBuildingException e )
  {
   LOGGER.warning("Could not process settings.xml: " + e.getMessage());
  }
  SettingsDecryptionResult result =
      settingsDecrypter.decrypt( new DefaultSettingsDecryptionRequest( settings ) );
  settings.setServers( result.getServers() );
  settings.setProxies( result.getProxies() );
 }
 return settings;
}

相关文章