Search in sources :

Example 11 with LocalRepository

use of org.eclipse.aether.repository.LocalRepository in project spring-cloud-function by spring-cloud.

the class DependencyResolutionModule method createSession.

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

Example 12 with LocalRepository

use of org.eclipse.aether.repository.LocalRepository in project mule by mulesoft.

the class RepositoryServiceFactory method createRepositoryService.

public RepositoryService createRepositoryService() {
    RepositorySystem repositorySystem = new SpiRepositorySystemFactory().createRepositorySystem();
    File repositoryFolder = createRepositoryFolderIfDoesNotExists();
    List<RemoteRepository> remoteRepositories = collectRemoteRepositories();
    DefaultRepositorySystemSession repositorySystemSession = new DefaultRepositorySystemSession();
    repositorySystemSession.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(repositorySystemSession, new LocalRepository(repositoryFolder)));
    return new DefaultRepositoryService(repositorySystem, repositorySystemSession, remoteRepositories);
}
Also used : RepositorySystem(org.eclipse.aether.RepositorySystem) DefaultRepositorySystemSession(org.eclipse.aether.DefaultRepositorySystemSession) LocalRepository(org.eclipse.aether.repository.LocalRepository) RemoteRepository(org.eclipse.aether.repository.RemoteRepository) File(java.io.File)

Example 13 with LocalRepository

use of org.eclipse.aether.repository.LocalRepository in project google-cloud-intellij by GoogleCloudPlatform.

the class CloudApiMavenService method newRepositorySystemSession.

private static DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system) {
    DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
    session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, new LocalRepository(JarRepositoryManager.getLocalRepositoryPath())));
    return session;
}
Also used : DefaultRepositorySystemSession(org.eclipse.aether.DefaultRepositorySystemSession) LocalRepository(org.eclipse.aether.repository.LocalRepository)

Example 14 with LocalRepository

use of org.eclipse.aether.repository.LocalRepository in project storm by apache.

the class Booter method newRepositorySystemSession.

public static RepositorySystemSession newRepositorySystemSession(RepositorySystem system, String localRepoPath) {
    DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
    LocalRepository localRepo = new LocalRepository(new File(localRepoPath).getAbsolutePath());
    session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
    return session;
}
Also used : DefaultRepositorySystemSession(org.eclipse.aether.DefaultRepositorySystemSession) LocalRepository(org.eclipse.aether.repository.LocalRepository) File(java.io.File)

Example 15 with LocalRepository

use of org.eclipse.aether.repository.LocalRepository in project spring-boot by spring-projects.

the class SettingsXmlRepositorySystemSessionAutoConfiguration method apply.

@Override
public void apply(DefaultRepositorySystemSession session, RepositorySystem repositorySystem) {
    MavenSettings settings = getSettings(session);
    String localRepository = settings.getLocalRepository();
    if (localRepository != null) {
        session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(session, new LocalRepository(localRepository)));
    }
}
Also used : LocalRepository(org.eclipse.aether.repository.LocalRepository) MavenSettings(org.springframework.boot.cli.compiler.maven.MavenSettings)

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