本文整理了Java中org.apache.maven.settings.Settings.setProxies()
方法的一些代码示例,展示了Settings.setProxies()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Settings.setProxies()
方法的具体详情如下:
包路径:org.apache.maven.settings.Settings
类名称:Settings
方法名:setProxies
[英]Set configuration for different proxy profiles. Multiple proxy profiles might come in handy for anyone working from a notebook or other mobile platform, to enable easy switching of entire proxy configurations by simply specifying the profile id, again either from the command line or from the defaults section below.
[中]为不同的代理配置文件设置配置。对于在笔记本电脑或其他移动平台上工作的任何人来说,多个代理配置文件可能很方便,只需指定配置文件id即可轻松切换整个代理配置,同样可以从命令行或下面的“默认值”部分进行。
代码示例来源:origin: apache/maven
settings.setProxies( proxies );
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.setProxies( proxies );
while ( parser.nextTag() == XmlPullParser.START_TAG )
代码示例来源: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.setProxies(new LinkedList<>());
mavenSettings.setProxies(newProxies);
代码示例来源: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.setProxies(decryptionResult.getProxies());
代码示例来源:origin: com.atlassian.confluence/confluence-stateless-test-runner
effectiveSettings.setProxies(decryptionResult.getProxies());
代码示例来源:origin: io.fabric8/maven-util
settingsDecrypter.decrypt(new DefaultSettingsDecryptionRequest(settings));
settings.setServers(result.getServers());
settings.setProxies(result.getProxies());
} catch (Exception ex) {
LOGGER.warn("Failed to decrypt maven settings.", ex);
代码示例来源:origin: org.fusesource/maven-util
settingsDecrypter.decrypt(new DefaultSettingsDecryptionRequest(settings));
settings.setServers(result.getServers());
settings.setProxies(result.getProxies());
} catch (Exception ex) {
LOGGER.warn("Failed to decrypt maven settings.", 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;
}
内容来源于网络,如有侵权,请联系作者删除!