Java Code Examples for org.eclipse.aether.DefaultRepositorySystemSession#setTransferListener()

The following examples show how to use org.eclipse.aether.DefaultRepositorySystemSession#setTransferListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Booter.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 2
Source File: RepositoryHandler.java    From maven-repository-tools with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example 3
Source File: ArtifactTransporter.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
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;
}
 
Example 4
Source File: RemotePluginRepository.java    From BIMserver with GNU Affero General Public License v3.0 5 votes vote down vote up
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;
}
 
Example 5
Source File: MavenContainer.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example 6
Source File: ShrinkwrapArtifactResolvingHelper.java    From thorntail with Apache License 2.0 4 votes vote down vote up
private void resetListeners() {
    final DefaultRepositorySystemSession session = session();
    session.setRepositoryListener(this.repositoryListener);
    session.setTransferListener(this.transferListener);
}
 
Example 7
Source File: ShrinkwrapArtifactResolvingHelper.java    From ARCHIVE-wildfly-swarm with Apache License 2.0 4 votes vote down vote up
private void resetListeners() {
    final DefaultRepositorySystemSession session = session();
    session.setRepositoryListener(this.repositoryListener);
    session.setTransferListener(this.transferListener);
}
 
Example 8
Source File: ArtifactResolverTest.java    From revapi with Apache License 2.0 3 votes vote down vote up
public static DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system,
        File localRepoLocation) {

    DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();

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

    session.setTransferListener(new AbstractTransferListener() {});
    session.setRepositoryListener(new AbstractRepositoryListener() {});

    return session;
}