Search in sources :

Example 36 with LocalRepository

use of org.eclipse.aether.repository.LocalRepository in project qpid-broker-j by apache.

the class Booter method newRepositorySystemSession.

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;
}
Also used : DefaultRepositorySystemSession(org.eclipse.aether.DefaultRepositorySystemSession) LocalRepository(org.eclipse.aether.repository.LocalRepository)

Example 37 with LocalRepository

use of org.eclipse.aether.repository.LocalRepository in project acceptance-test-harness by jenkinsci.

the class AetherModule method newRepositorySystemSession.

@Provides
public RepositorySystemSession newRepositorySystemSession(RepositorySystem system) {
    DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
    LocalRepository localRepo = new LocalRepository(MavenLocalRepository.getMavenLocalRepository());
    session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
    session.setTransferListener(new ConsoleTransferListener() {

        @Override
        public void transferProgressed(TransferEvent event) {
        // NOOP
        }
    });
    return session;
}
Also used : DefaultRepositorySystemSession(org.eclipse.aether.DefaultRepositorySystemSession) LocalRepository(org.eclipse.aether.repository.LocalRepository) MavenLocalRepository(org.jenkinsci.test.acceptance.utils.MavenLocalRepository) TransferEvent(org.eclipse.aether.transfer.TransferEvent) Provides(com.google.inject.Provides)

Example 38 with LocalRepository

use of org.eclipse.aether.repository.LocalRepository in project gate-core by GateNLP.

the class Utils method getRepositorySession.

public static DefaultRepositorySystemSession getRepositorySession(RepositorySystem repoSystem, WorkspaceReader workspace) {
    DefaultRepositorySystemSession repoSystemSession = MavenRepositorySystemUtils.newSession();
    String repoLocation = System.getProperty("user.home") + File.separator + ".m2" + File.separator + "repository/";
    try {
        Settings effectiveSettings = loadMavenSettings();
        if (effectiveSettings.getLocalRepository() != null) {
            repoLocation = effectiveSettings.getLocalRepository();
        }
    } catch (Exception e) {
        log.warn("Unable to load Maven settings, using default repository location", e);
    }
    LocalRepository localRepo = new LocalRepository(repoLocation);
    log.debug("Using local repository at: " + repoLocation);
    repoSystemSession.setLocalRepositoryManager(repoSystem.newLocalRepositoryManager(repoSystemSession, localRepo));
    // repoSystemSession.setWorkspaceReader(new SimpleMavenCache(new File("repo")));
    if (workspace != null)
        repoSystemSession.setWorkspaceReader(workspace);
    return repoSystemSession;
}
Also used : DefaultRepositorySystemSession(org.eclipse.aether.DefaultRepositorySystemSession) LocalRepository(org.eclipse.aether.repository.LocalRepository) Settings(org.apache.maven.settings.Settings) SettingsBuildingException(org.apache.maven.settings.building.SettingsBuildingException)

Example 39 with LocalRepository

use of org.eclipse.aether.repository.LocalRepository in project pinpoint by naver.

the class DependencyResolver method newRepositorySystemSession.

static DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system) {
    DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
    session.setCache(newRepositoryCache());
    String localRepositoryPath = resolveLocalRepository();
    if (logger.isInfoEnabled()) {
        logger.info("Local repository: {}", localRepositoryPath);
    }
    LocalRepository localRepository = new LocalRepository(localRepositoryPath);
    LocalRepositoryManager localRepositoryManager = system.newLocalRepositoryManager(session, localRepository);
    session.setLocalRepositoryManager(localRepositoryManager);
    return session;
}
Also used : DefaultRepositorySystemSession(org.eclipse.aether.DefaultRepositorySystemSession) LocalRepositoryManager(org.eclipse.aether.repository.LocalRepositoryManager) LocalRepository(org.eclipse.aether.repository.LocalRepository)

Example 40 with LocalRepository

use of org.eclipse.aether.repository.LocalRepository in project launcher by runelite.

the class ArtifactResolver method newRepositorySystemSession.

public DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system) {
    DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
    LocalRepository localRepo = new LocalRepository(repositoryCache.getAbsolutePath());
    session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
    session.setTransferListener(listener);
    return session;
}
Also used : DefaultRepositorySystemSession(org.eclipse.aether.DefaultRepositorySystemSession) LocalRepository(org.eclipse.aether.repository.LocalRepository)

Aggregations

LocalRepository (org.eclipse.aether.repository.LocalRepository)42 DefaultRepositorySystemSession (org.eclipse.aether.DefaultRepositorySystemSession)34 File (java.io.File)15 RemoteRepository (org.eclipse.aether.repository.RemoteRepository)8 IOException (java.io.IOException)6 ArrayList (java.util.ArrayList)6 RepositorySystem (org.eclipse.aether.RepositorySystem)6 JarFile (java.util.jar.JarFile)5 DefaultArtifact (org.eclipse.aether.artifact.DefaultArtifact)5 SimpleLocalRepositoryManagerFactory (org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory)5 LocalRepositoryManager (org.eclipse.aether.repository.LocalRepositoryManager)5 MalformedURLException (java.net.MalformedURLException)4 LinkedList (java.util.LinkedList)4 Artifact (org.eclipse.aether.artifact.Artifact)4 DefaultServiceLocator (org.eclipse.aether.impl.DefaultServiceLocator)4 URL (java.net.URL)3 DefaultMavenExecutionRequest (org.apache.maven.execution.DefaultMavenExecutionRequest)3 MavenExecutionRequest (org.apache.maven.execution.MavenExecutionRequest)3 ArtifactResult (org.eclipse.aether.resolution.ArtifactResult)3 VersionConstraint (org.eclipse.aether.version.VersionConstraint)3