use of org.apache.maven.artifact.ant.RemoteRepository in project robolectric by robolectric.
the class MavenDependencyResolverTest method getLocalArtifactUrl_shouldAddConfiguredRemoteRepository.
@Test
public void getLocalArtifactUrl_shouldAddConfiguredRemoteRepository() {
DependencyResolver dependencyResolver = createResolver();
DependencyJar dependencyJar = new DependencyJar("group1", "artifact1", "", null);
dependencyResolver.getLocalArtifactUrl(dependencyJar);
List<RemoteRepository> repositories = dependenciesTask.getRemoteRepositories();
assertEquals(1, repositories.size());
RemoteRepository remoteRepository = repositories.get(0);
assertEquals(REPOSITORY_URL, remoteRepository.getUrl());
assertEquals(REPOSITORY_ID, remoteRepository.getId());
}
use of org.apache.maven.artifact.ant.RemoteRepository in project gradle by gradle.
the class MavenDeployAction method createRepository.
private org.sonatype.aether.repository.RemoteRepository createRepository(RemoteRepository gradleRepo) {
org.sonatype.aether.repository.RemoteRepository repo = new org.sonatype.aether.repository.RemoteRepository("remote", gradleRepo.getLayout(), gradleRepo.getUrl());
org.apache.maven.artifact.ant.Authentication auth = gradleRepo.getAuthentication();
if (auth != null) {
repo.setAuthentication(new Authentication(auth.getUserName(), auth.getPassword(), auth.getPrivateKey(), auth.getPassphrase()));
}
org.apache.maven.artifact.ant.Proxy proxy = gradleRepo.getProxy();
if (proxy != null) {
DefaultProxySelector proxySelector = new DefaultProxySelector();
Authentication proxyAuth = new Authentication(proxy.getUserName(), proxy.getPassword());
proxySelector.add(new Proxy(proxy.getType(), proxy.getHost(), proxy.getPort(), proxyAuth), proxy.getNonProxyHosts());
repo.setProxy(proxySelector.getProxy(repo));
}
return repo;
}
use of org.apache.maven.artifact.ant.RemoteRepository in project gradle by gradle.
the class DefaultGroovyMavenDeployer method createRepository.
private RemoteRepository createRepository(Map properties) {
RemoteRepository repository = new MavenRemoteRepository();
ConfigureUtil.configureByMap(properties, repository);
return repository;
}
use of org.apache.maven.artifact.ant.RemoteRepository in project gradle by gradle.
the class DefaultGroovyMavenDeployer method snapshotRepository.
public RemoteRepository snapshotRepository(Map properties) {
RemoteRepository repository = createRepository(properties);
setSnapshotRepository(repository);
return repository;
}
use of org.apache.maven.artifact.ant.RemoteRepository in project gradle by gradle.
the class DefaultGroovyMavenDeployer method repository.
public RemoteRepository repository(Map properties, Closure closure) {
RemoteRepository repository = createRepository(properties, closure);
setRepository(repository);
return repository;
}
Aggregations