Search in sources :

Example 1 with JreProxySelector

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

the class DefaultRepositorySystemSessionAutoConfiguration method apply.

@Override
public void apply(DefaultRepositorySystemSession session, RepositorySystem repositorySystem) {
    if (session.getLocalRepositoryManager() == null) {
        LocalRepository localRepository = new LocalRepository(getM2RepoDirectory());
        LocalRepositoryManager localRepositoryManager = repositorySystem.newLocalRepositoryManager(session, localRepository);
        session.setLocalRepositoryManager(localRepositoryManager);
    }
    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);
    }
}
Also used : ProxySelector(org.eclipse.aether.repository.ProxySelector) JreProxySelector(org.eclipse.aether.util.repository.JreProxySelector) LocalRepositoryManager(org.eclipse.aether.repository.LocalRepositoryManager) LocalRepository(org.eclipse.aether.repository.LocalRepository) JreProxySelector(org.eclipse.aether.util.repository.JreProxySelector)

Aggregations

LocalRepository (org.eclipse.aether.repository.LocalRepository)1 LocalRepositoryManager (org.eclipse.aether.repository.LocalRepositoryManager)1 ProxySelector (org.eclipse.aether.repository.ProxySelector)1 JreProxySelector (org.eclipse.aether.util.repository.JreProxySelector)1