Search in sources :

Example 1 with RepositoryEvent

use of org.eclipse.aether.RepositoryEvent in project spf4j by zolyfarkas.

the class MavenRepositoryUtils method getRepositorySystemSession.

public static RepositorySystemSession getRepositorySystemSession(final RepositorySystem system, final File localRepoPath) {
    DefaultRepositorySystemSession repositorySystemSession = MavenRepositorySystemUtils.newSession();
    LocalRepository localRepository = new LocalRepository(localRepoPath);
    repositorySystemSession.setLocalRepositoryManager(system.newLocalRepositoryManager(repositorySystemSession, localRepository));
    repositorySystemSession.setRepositoryListener(new AbstractRepositoryListener() {

        @Override
        public void artifactDownloaded(final RepositoryEvent event) {
            LOG.info("Downloaded artifact {}", event);
        }
    });
    return repositorySystemSession;
}
Also used : AbstractRepositoryListener(org.eclipse.aether.AbstractRepositoryListener) DefaultRepositorySystemSession(org.eclipse.aether.DefaultRepositorySystemSession) RepositoryEvent(org.eclipse.aether.RepositoryEvent) LocalRepository(org.eclipse.aether.repository.LocalRepository)

Aggregations

AbstractRepositoryListener (org.eclipse.aether.AbstractRepositoryListener)1 DefaultRepositorySystemSession (org.eclipse.aether.DefaultRepositorySystemSession)1 RepositoryEvent (org.eclipse.aether.RepositoryEvent)1 LocalRepository (org.eclipse.aether.repository.LocalRepository)1