Search in sources :

Example 1 with DefaultMavenArtifactRepository

use of org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository in project gradle by gradle.

the class MavenRemotePublisher method publish.

@Override
public void publish(MavenNormalizedPublication publication, MavenArtifactRepository artifactRepository) {
    URI repositoryUrl = artifactRepository.getUrl();
    LOGGER.info("Publishing to repository '{}' ({})", artifactRepository.getName(), repositoryUrl);
    String protocol = repositoryUrl.getScheme().toLowerCase();
    DefaultMavenArtifactRepository realRepository = (DefaultMavenArtifactRepository) artifactRepository;
    RepositoryTransport transport = realRepository.getTransport(protocol);
    ExternalResourceRepository repository = transport.getRepository();
    publish(publication, repository, repositoryUrl, false);
}
Also used : RepositoryTransport(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport) URI(java.net.URI) DefaultMavenArtifactRepository(org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository) ExternalResourceRepository(org.gradle.internal.resource.ExternalResourceRepository)

Aggregations

URI (java.net.URI)1 DefaultMavenArtifactRepository (org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository)1 RepositoryTransport (org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport)1 ExternalResourceRepository (org.gradle.internal.resource.ExternalResourceRepository)1