use of org.apache.maven.artifact.ant.RemoteRepository in project gradle by gradle.
the class DefaultGroovyMavenDeployer method snapshotRepository.
public RemoteRepository snapshotRepository(Map properties, Closure closure) {
RemoteRepository repository = createRepository(properties, closure);
setSnapshotRepository(repository);
return repository;
}
use of org.apache.maven.artifact.ant.RemoteRepository in project gradle by gradle.
the class DefaultGroovyMavenDeployer method createRepository.
private RemoteRepository createRepository(Map properties, Closure closure) {
RemoteRepository repository = new MavenRemoteRepository();
ConfigureUtil.configureByMap(properties, repository);
// Should be using ConfigureUtil (with DELEGATE_FIRST strategy), however for backwards compatibility need to use OWNER_FIRST
new ClosureBackedAction<RemoteRepository>(closure, Closure.OWNER_FIRST).execute(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) {
RemoteRepository repository = createRepository(properties);
setRepository(repository);
return repository;
}
use of org.apache.maven.artifact.ant.RemoteRepository in project gradle by gradle.
the class MavenRemotePublisher method createMavenRemoteRepository.
private RemoteRepository createMavenRemoteRepository(MavenArtifactRepository repository) {
RemoteRepository remoteRepository = new RemoteRepository();
remoteRepository.setUrl(repository.getUrl().toString());
return remoteRepository;
}
use of org.apache.maven.artifact.ant.RemoteRepository in project gradle by gradle.
the class MavenDeployAction method publishArtifacts.
@Override
protected void publishArtifacts(Collection<Artifact> artifacts, RepositorySystem repositorySystem, RepositorySystemSession session) throws DeploymentException {
RemoteRepository gradleRepo = remoteRepository;
if (artifacts.iterator().next().isSnapshot() && remoteSnapshotRepository != null) {
gradleRepo = remoteSnapshotRepository;
}
if (gradleRepo == null) {
throw new GradleException("Must specify a repository for deployment");
}
org.sonatype.aether.repository.RemoteRepository aetherRepo = createRepository(gradleRepo);
DeployRequest request = new DeployRequest();
request.setRepository(aetherRepo);
for (Artifact artifact : artifacts) {
request.addArtifact(artifact);
}
LOGGER.info("Deploying to {}", gradleRepo.getUrl());
repositorySystem.deploy(session, request);
}
Aggregations