当前位置: 首页>>代码示例>>Java>>正文


Java DefaultRepositorySystemSession.setProxySelector方法代码示例

本文整理汇总了Java中org.eclipse.aether.DefaultRepositorySystemSession.setProxySelector方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultRepositorySystemSession.setProxySelector方法的具体用法?Java DefaultRepositorySystemSession.setProxySelector怎么用?Java DefaultRepositorySystemSession.setProxySelector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.aether.DefaultRepositorySystemSession的用法示例。


在下文中一共展示了DefaultRepositorySystemSession.setProxySelector方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: apply

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
@Override
public void apply(DefaultRepositorySystemSession session,
		RepositorySystem repositorySystem) {

	if (session.getLocalRepositoryManager() == null) {
		LocalRepository localRepository = new LocalRepository(getM2RepoDirectory());
		LocalRepositoryManager localRepositoryManager = repositorySystem
				.newLocalRepositoryManager(session, localRepository);
		session.setLocalRepositoryManager(localRepositoryManager);
	}

	ProxySelector existing = session.getProxySelector();
	if (existing == null || !(existing instanceof CompositeProxySelector)) {
		JreProxySelector fallback = new JreProxySelector();
		ProxySelector selector = existing == null ? fallback
				: new CompositeProxySelector(Arrays.asList(existing, fallback));
		session.setProxySelector(selector);
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:20,代码来源:DefaultRepositorySystemSessionAutoConfiguration.java

示例2: newRepositorySystemSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system, String localRepoPath) {
	DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
	LocalRepository localRepo = new LocalRepository(localRepoPath);
	session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
	session.setOffline(this.properties.isOffline());
	if (this.properties.getConnectTimeout() != null) {
		session.setConfigProperty(ConfigurationProperties.CONNECT_TIMEOUT, this.properties.getConnectTimeout());
	}
	if (this.properties.getRequestTimeout() != null) {
		session.setConfigProperty(ConfigurationProperties.REQUEST_TIMEOUT, this.properties.getRequestTimeout());
	}
	if (isProxyEnabled()) {
		DefaultProxySelector proxySelector = new DefaultProxySelector();
		Proxy proxy = new Proxy(this.properties.getProxy().getProtocol(),
				this.properties.getProxy().getHost(),
				this.properties.getProxy().getPort(),
				this.authentication);
		proxySelector.add(proxy, this.properties.getProxy().getNonProxyHosts());
		session.setProxySelector(proxySelector);
	}
	return session;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer,代码行数:23,代码来源:MavenArtifactResolver.java

示例3: applySettings

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public static void applySettings(MavenSettings settings,
		DefaultRepositorySystemSession session) {
	if (settings.getLocalRepository() != null) {
		try {
			session.setLocalRepositoryManager(
					new SimpleLocalRepositoryManagerFactory().newInstance(session,
							new LocalRepository(settings.getLocalRepository())));
		}
		catch (NoLocalRepositoryManagerException e) {
			throw new IllegalStateException(
					"Cannot set local repository to " + settings.getLocalRepository(),
					e);
		}
	}
	session.setOffline(settings.getOffline());
	session.setMirrorSelector(settings.getMirrorSelector());
	session.setAuthenticationSelector(settings.getAuthenticationSelector());
	session.setProxySelector(settings.getProxySelector());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-function,代码行数:20,代码来源:MavenSettingsReader.java

示例4: createSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private DefaultRepositorySystemSession createSession(Properties properties)
		throws NoLocalRepositoryManagerException {
	DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
	LocalRepository repository = localRepository(properties);
	session.setLocalRepositoryManager(
			localRepositoryManagerFactory.newInstance(session, repository));
	applySettings(session);
	ProxySelector existing = session.getProxySelector();
	if (existing == null || !(existing instanceof CompositeProxySelector)) {
		JreProxySelector fallback = new JreProxySelector();
		ProxySelector selector = existing == null ? fallback
				: new CompositeProxySelector(Arrays.asList(existing, fallback));
		session.setProxySelector(selector);
	}
	return session;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-function,代码行数:17,代码来源:DependencyResolver.java

示例5: createRepositorySession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private DefaultRepositorySystemSession createRepositorySession() {
    DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
    session.setProxySelector(new ConservativeProxySelector(new JreProxySelector()));

    LocalRepository localRepo = new LocalRepository(localRepository);
    try {
        session.setLocalRepositoryManager(
                new EnhancedLocalRepositoryManagerFactory().newInstance(session, localRepo));
    }
    catch (NoLocalRepositoryManagerException e1) {
    }
    return session;
}
 
开发者ID:atomist-attic,项目名称:rug-resolver,代码行数:14,代码来源:AbstractMavenBasedDeployer.java

示例6: getSettings

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private MavenSettings getSettings(DefaultRepositorySystemSession session) {
	MavenSettings settings = new MavenSettingsReader().readSettings();
	session.setOffline(settings.getOffline());
	session.setMirrorSelector(settings.getMirrorSelector());
	session.setAuthenticationSelector(settings.getAuthenticationSelector());
	session.setProxySelector(settings.getProxySelector());
	return settings;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:SettingsXmlRepositorySystemSessionAutoConfiguration.java

示例7: newSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public RepositorySystemSession newSession(RepositorySystem system, LocalRepository localRepository) {
	DefaultRepositorySystemSession session;
	session = MavenRepositorySystemUtils.newSession();
	final LocalRepositoryManager localRepositoryManager = system.newLocalRepositoryManager(session,localRepository);
	session.setLocalRepositoryManager(localRepositoryManager);
	session.setTransferListener(new ConsoleTransferListener(System.out));
	session.setRepositoryListener(new ConsoleRepositoryListener(System.out));
	disableLocalCaching(session);
	disableArtifactNotFoundCache(session);
	disableHttpsCertificateCheck(session);
	session.setProxySelector(proxyManager.selectProxies());
	session.setReadOnly();
	return session;
}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:15,代码来源:AetherConfigurer.java

示例8: setupRepoSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public DefaultRepositorySystemSession setupRepoSession(final RepositorySystem repoSystem, final Settings settings)
{
   DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
   session.setOffline(false);

   Proxy activeProxy = settings.getActiveProxy();
   if (activeProxy != null)
   {
      DefaultProxySelector dps = new DefaultProxySelector();
      dps.add(convertFromMavenProxy(activeProxy), activeProxy.getNonProxyHosts());
      session.setProxySelector(dps);
   }

   final DefaultMirrorSelector mirrorSelector = createMirrorSelector(settings);
   final LazyAuthenticationSelector authSelector = createAuthSelector(settings, mirrorSelector);

   session.setMirrorSelector(mirrorSelector);
   session.setAuthenticationSelector(authSelector);

   LocalRepository localRepo = new LocalRepository(new File(settings.getLocalRepository()));
   session.setLocalRepositoryManager(repoSystem.newLocalRepositoryManager(session, localRepo));
   session.setChecksumPolicy(RepositoryPolicy.CHECKSUM_POLICY_IGNORE);
   session.setCache(new DefaultRepositoryCache());
   boolean cacheNotFoundArtifacts = true;
   boolean cacheTransferErrors = true;
   session.setResolutionErrorPolicy(new SimpleResolutionErrorPolicy(cacheNotFoundArtifacts, cacheTransferErrors));
   session.setWorkspaceReader(new ClasspathWorkspaceReader());
   if (Boolean.getBoolean("org.apache.maven.log_transfer"))
   {
      session.setTransferListener(new JULMavenTransferListener());
   }
   return session;
}
 
开发者ID:forge,项目名称:furnace,代码行数:34,代码来源:MavenContainer.java

示例9: setupRepoSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public DefaultRepositorySystemSession setupRepoSession(final RepositorySystem repoSystem, final Settings settings)
{
   DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
   session.setOffline(false);

   Proxy activeProxy = settings.getActiveProxy();
   if (activeProxy != null)
   {
      DefaultProxySelector dps = new DefaultProxySelector();
      dps.add(convertFromMavenProxy(activeProxy), activeProxy.getNonProxyHosts());
      session.setProxySelector(dps);
   }

   final DefaultMirrorSelector mirrorSelector = createMirrorSelector(settings);
   final LazyAuthenticationSelector authSelector = createAuthSelector(settings, mirrorSelector);

   session.setMirrorSelector(mirrorSelector);
   session.setAuthenticationSelector(authSelector);

   LocalRepository localRepo = new LocalRepository(new File(settings.getLocalRepository()));
   session.setLocalRepositoryManager(repoSystem.newLocalRepositoryManager(session, localRepo));
   session.setChecksumPolicy(RepositoryPolicy.CHECKSUM_POLICY_IGNORE);
   session.setCache(new DefaultRepositoryCache());
   boolean cacheNotFoundArtifacts = true;
   boolean cacheTransferErrors = true;
   session.setResolutionErrorPolicy(new SimpleResolutionErrorPolicy(cacheNotFoundArtifacts, cacheTransferErrors));
   session.setWorkspaceReader(new ClasspathWorkspaceReader());
   session.setTransferListener(new LogTransferListener(System.out));
   return session;
}
 
开发者ID:koentsje,项目名称:forge-furnace,代码行数:31,代码来源:MavenContainer.java


注:本文中的org.eclipse.aether.DefaultRepositorySystemSession.setProxySelector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。