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


Java DefaultRepositorySystemSession.setTransferListener方法代码示例

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


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

示例1: create

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
/**
 * Uses the passed Settings in order to configure and create the session
 * */
public RepositorySystemSession create(){
       DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();

       session.setOffline(settings.getOffline()!=null ? settings.getOffline().booleanValue() : false);
       session.setIgnoreArtifactDescriptorRepositories(true);
       
       session.setChecksumPolicy(RepositoryPolicy.CHECKSUM_POLICY_WARN);
       session.setUpdatePolicy(settings.getUpdatePolicy());
       
       LocalRepository localRepo = new LocalRepository(settings.getLocalRepository());
       session.setLocalRepositoryManager( repositorySystem.newLocalRepositoryManager( session, localRepo ) );

       session.setRepositoryListener( new microsofia.boot.aether.RepositoryListener() );
       session.setTransferListener( new microsofia.boot.aether.TransferListener() );

       /*TODO 	should allow the followig to be configured via settings file? (if needed)
        * 		session.setResolutionErrorPolicy();
       		session.setArtifactDescriptorPolicy(artifactDescriptorPolicy)
       		session.setSystemProperties(systemProperties)
       		session.setUserProperties(userProperties)
       		session.setConfigProperties(configProperties)*/
       
       return session;
   }
 
开发者ID:microsofia,项目名称:microsofia-boot,代码行数:28,代码来源:RepositorySystemSessionBuilder.java

示例2: newRepositorySystemSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private DefaultRepositorySystemSession newRepositorySystemSession(
		RepositorySystem system) {

	DefaultRepositorySystemSession session = MavenRepositorySystemUtils
			.newSession();

	// every container must have one
	session.setLocalRepositoryManager(system.newLocalRepositoryManager(
			session, findLocalRepository()));

	// logging for the activity
	PrintStream logger = new LoggerStream(LOG, Level.INFO);
	session.setTransferListener(new LoggingTransferListener());
	session.setRepositoryListener(new LoggingRepositoryListener());

	// uncomment to generate dirty trees
	// session.setDependencyGraphTransformer( null );

	// ignore checksums on smartbear
	session.setChecksumPolicy(RepositoryPolicy.CHECKSUM_POLICY_IGNORE);

	return session;
}
 
开发者ID:bertramn,项目名称:soapui-junit-mockrunner,代码行数:24,代码来源:AetherClasspathResolver.java

示例3: newRepositorySystemSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public static DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system) {
    DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();

    LocalRepository localRepo = new LocalRepository("target/local-repo");
    session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));

    session.setTransferListener(new ConsoleTransferListener());
    session.setRepositoryListener(new ConsoleRepositoryListener());

    return session;
}
 
开发者ID:AGETO,项目名称:hybris-maven-plugin,代码行数:12,代码来源:Booter.java

示例4: 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

示例5: getAvailableVersions

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
@Override
public List<String> getAvailableVersions(String artifactGroup, String artifactName, List<PluginRepository> remoteRepositories) {
    List<String> versions = new ArrayList<>();
    try {
        // TODO figure out how to force remote check
        VersionRangeRequest rangeRequest = new VersionRangeRequest();
        rangeRequest.setArtifact(new DefaultArtifact(artifactGroup, artifactName, "jar", "[0,)"));
        if (remoteRepositories != null) {
            for (PluginRepository pluginRepository : remoteRepositories) {
                rangeRequest.addRepository(
                        new RemoteRepository.Builder(pluginRepository.getName(), "default", pluginRepository.getUrl()).build());
            }
        }
        DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
        File tempDir = new File(System.getProperty("java.io.tmpdir"), "temp-local-repo");
        tempDir.mkdirs();
        LocalRepository localRepo = new LocalRepository(tempDir.getAbsolutePath());
        session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(session, localRepo));
        session.setTransferListener(new PluginTransferListener());
        session.setRepositoryListener(new PluginRepositoryListener());
        VersionRangeResult rangeResult = repositorySystem.resolveVersionRange(session, rangeRequest);
        if (rangeResult != null) {
            List<Version> versionList = rangeResult.getVersions();
            for (Version version : versionList) {
                versions.add(version.toString());
            }
        }
        FileUtils.deleteQuietly(tempDir);
    } catch (VersionRangeResolutionException e) {
        logger.error("", e);
    }
    return versions;
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:34,代码来源:PluginManager.java

示例6: newRepositorySystemSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private static DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem repositorySystem, String localRepositoryPath) {
    DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
    LocalRepository localRepo = new LocalRepository(localRepositoryPath);
    session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(session, localRepo));
    session.setTransferListener(new PluginTransferListener());
    session.setRepositoryListener(new PluginRepositoryListener());
    return session;
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:9,代码来源:PluginManager.java

示例7: newRepositorySystemSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private static DefaultRepositorySystemSession newRepositorySystemSession( RepositorySystem system, 
                                                                         File localRepoPath )
{
    DefaultRepositorySystemSession newSession = MavenRepositorySystemUtils.newSession();

    LocalRepository localRepo = new LocalRepository( localRepoPath );
    newSession.setLocalRepositoryManager( system.newLocalRepositoryManager( newSession, localRepo ) );

    newSession.setTransferListener( getTransferListener() );
    newSession.setRepositoryListener( repositoryListener );

    return newSession;
}
 
开发者ID:simpligility,项目名称:maven-repository-tools,代码行数:14,代码来源:RepositoryHandler.java

示例8: newRepositorySystemSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public static DefaultRepositorySystemSession newRepositorySystemSession ( final Path tempDir, final RepositorySystem system )
{
    final DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession ();

    final LocalRepository localRepo = new LocalRepository ( tempDir.toFile () );
    session.setLocalRepositoryManager ( system.newLocalRepositoryManager ( session, localRepo ) );

    session.setTransferListener ( new LoggerTransferListener () );
    session.setConfigProperty ( ConfigurationProperties.USER_AGENT, VersionInformation.USER_AGENT );

    return session;
}
 
开发者ID:ctron,项目名称:package-drone,代码行数:13,代码来源:Helper.java

示例9: newRepositorySystemSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public RepositorySystemSession newRepositorySystemSession(RepositorySystem system) {
  DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
  LocalRepository localRepo = new LocalRepository(localRepositoryPath);
  session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
  session.setTransferListener(new AbstractTransferListener() {});
  session.setRepositoryListener(new AbstractRepositoryListener() {});
  return session;
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:9,代码来源:MavenConnector.java

示例10: createSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private static RepositorySystemSession createSession(RepositorySystem system, File baseDir) {
     DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();

     LocalRepository localRepo = new LocalRepository(baseDir);
     session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));

     session.setTransferListener(new LoggingTransferListener());
     session.setRepositoryListener(new LoggingRepositoryListener());

     // uncomment to generate dirty trees
     // session.setDependencyGraphTransformer( null );

     return session;
}
 
开发者ID:MovingBlocks,项目名称:ModuleManager,代码行数:15,代码来源:RepositoryConnector.java

示例11: newRepositorySystemSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system) {
    DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();

    LocalRepository localRepo = new LocalRepository(localRepositoryLocation.toAbsolutePath().toString());
    session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));

    session.setTransferListener(new ConsoleTransferListener());
    session.setRepositoryListener(new ConsoleRepositoryListener());

    return session;
}
 
开发者ID:jan-molak,项目名称:jenkins-build-monitor-plugin,代码行数:12,代码来源:ArtifactTransporter.java

示例12: newRepositorySystemSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public static DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system) {
	DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();

	LocalRepository localRepo = new LocalRepository("target/local-repo");
	session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));

	session.setTransferListener(new ConsoleTransferListener());
	session.setRepositoryListener(new ConsoleRepositoryListener());

	// uncomment to generate dirty trees
	// session.setDependencyGraphTransformer( null );

	return session;
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:15,代码来源:RemotePluginRepository.java

示例13: 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

示例14: createRepositorySystemSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private RepositorySystemSession createRepositorySystemSession(RepositorySystem system,
		LocalRepository localRepository) {
	DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
	session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepository));
	session.setTransferListener(new ConsoleTransferListener());
	session.setRepositoryListener(new ConsoleRepositoryListener());
	session.setReadOnly();
	return session;
}
 
开发者ID:ylemoigne,项目名称:vertx-mod-webjar,代码行数:10,代码来源:WebjarPullerVerticle.java

示例15: repositorySystemSession

import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
@Bean
public RepositorySystemSession repositorySystemSession(RepositorySystem repositorySystem) {
    // see MavenRepositorySystemUtils.newSession()

    DependencySelector selector = new AndDependencySelector(
            new ScopeDependencySelector("test", "provided"),
            new DepthOneOptionalDependencySelector(),
            new ExclusionDependencySelector());

    DependencyGraphTransformer transformer = new ConflictResolver(
            new NearestVersionSelector(),
            new JavaScopeSelector(),
            new SimpleOptionalitySelector(),
            new JavaScopeDeriver());

    DefaultRepositorySystemSession session = new DefaultRepositorySystemSession();
    session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(session, localRepository()));
    session.setSystemProperties(System.getProperties());
    session.setConfigProperties(System.getProperties());
    session.setArtifactTypeRegistry(artifactTypeRegistry());
    session.setDependencyManager(new ClassicDependencyManager());
    session.setArtifactDescriptorPolicy(new SimpleArtifactDescriptorPolicy(true, true));
    session.setDependencySelector(selector);
    session.setDependencyGraphTransformer(transformer);
    session.setTransferListener(new LogTransferListener());
    session.setRepositoryListener(new LogRepositoryListener());

    if (!session.getConfigProperties().containsKey(ConfigurationProperties.REQUEST_TIMEOUT)) {
        session.setConfigProperty(ConfigurationProperties.REQUEST_TIMEOUT, 3 * 60 * 1000);
    }

    return session;
}
 
开发者ID:release-engineering,项目名称:redhat-repository-validator,代码行数:34,代码来源:AppConfig.java


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