Search in sources :

Example 1 with ExternalResourceRepository

use of org.gradle.internal.resource.ExternalResourceRepository 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)

Example 2 with ExternalResourceRepository

use of org.gradle.internal.resource.ExternalResourceRepository in project gradle by gradle.

the class MavenLocalPublisher method publish.

@Override
public void publish(MavenNormalizedPublication publication, @Nullable MavenArtifactRepository artifactRepository) {
    LOGGER.info("Publishing to maven local repository");
    URI rootUri = mavenRepositoryLocator.getLocalMavenRepository().toURI();
    RepositoryTransport transport = repositoryTransportFactory.createFileTransport("mavenLocal");
    ExternalResourceRepository repository = transport.getRepository();
    publish(publication, repository, rootUri, true);
}
Also used : RepositoryTransport(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport) URI(java.net.URI) ExternalResourceRepository(org.gradle.internal.resource.ExternalResourceRepository)

Example 3 with ExternalResourceRepository

use of org.gradle.internal.resource.ExternalResourceRepository in project gradle by gradle.

the class DefaultSignatureVerificationServiceFactory method create.

@Override
public SignatureVerificationService create(BuildTreeDefinedKeys keyrings, List<URI> keyServers, boolean useKeyServers) {
    boolean refreshKeys = this.refreshKeys || !useKeyServers;
    ExternalResourceRepository repository = transportFactory.createTransport("https", "https", Collections.emptyList(), redirectLocations -> {
    }).getRepository();
    PublicKeyService keyService;
    if (useKeyServers) {
        PublicKeyDownloadService keyDownloadService = new PublicKeyDownloadService(ImmutableList.copyOf(keyServers), repository);
        keyService = new CrossBuildCachingKeyService(cacheRepository, decoratorFactory, buildOperationExecutor, keyDownloadService, timeProvider, refreshKeys);
    } else {
        keyService = EmptyPublicKeyService.getInstance();
    }
    keyService = keyrings.applyTo(keyService);
    File effectiveKeyringsFile = keyrings.getEffectiveKeyringsFile();
    HashCode keyringFileHash = effectiveKeyringsFile != null && effectiveKeyringsFile.exists() ? fileHasher.hash(effectiveKeyringsFile) : NO_KEYRING_FILE_HASH;
    DefaultSignatureVerificationService delegate = new DefaultSignatureVerificationService(keyService);
    return new CrossBuildSignatureVerificationService(delegate, fileHasher, buildScopedCache, decoratorFactory, timeProvider, refreshKeys, useKeyServers, keyringFileHash);
}
Also used : Hashing(org.gradle.internal.hash.Hashing) BuildCommencedTimeProvider(org.gradle.util.internal.BuildCommencedTimeProvider) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) FileHasher(org.gradle.internal.hash.FileHasher) UncheckedException(org.gradle.internal.UncheckedException) ImmutableList(com.google.common.collect.ImmutableList) PublicKeyService(org.gradle.security.internal.PublicKeyService) BuildScopedCache(org.gradle.cache.scopes.BuildScopedCache) PGPPublicKeyRing(org.bouncycastle.openpgp.PGPPublicKeyRing) InMemoryCacheDecoratorFactory(org.gradle.cache.internal.InMemoryCacheDecoratorFactory) PublicKeyDownloadService(org.gradle.security.internal.PublicKeyDownloadService) URI(java.net.URI) Fingerprint(org.gradle.security.internal.Fingerprint) PGPException(org.bouncycastle.openpgp.PGPException) RepositoryTransportFactory(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransportFactory) Scopes(org.gradle.internal.service.scopes.Scopes) PGPSignatureList(org.bouncycastle.openpgp.PGPSignatureList) PublicKeyResultBuilder(org.gradle.security.internal.PublicKeyResultBuilder) SecuritySupport.toLongIdHexString(org.gradle.security.internal.SecuritySupport.toLongIdHexString) ExternalResourceRepository(org.gradle.internal.resource.ExternalResourceRepository) PGPSignature(org.bouncycastle.openpgp.PGPSignature) Set(java.util.Set) PGPPublicKey(org.bouncycastle.openpgp.PGPPublicKey) IOException(java.io.IOException) ServiceScope(org.gradle.internal.service.scopes.ServiceScope) HashCode(org.gradle.internal.hash.HashCode) File(java.io.File) UncheckedIOException(java.io.UncheckedIOException) List(java.util.List) BuildOperationExecutor(org.gradle.internal.operations.BuildOperationExecutor) SecuritySupport(org.gradle.security.internal.SecuritySupport) GlobalScopedCache(org.gradle.cache.scopes.GlobalScopedCache) EmptyPublicKeyService(org.gradle.security.internal.EmptyPublicKeyService) Collections(java.util.Collections) HashCode(org.gradle.internal.hash.HashCode) PublicKeyService(org.gradle.security.internal.PublicKeyService) EmptyPublicKeyService(org.gradle.security.internal.EmptyPublicKeyService) PublicKeyDownloadService(org.gradle.security.internal.PublicKeyDownloadService) File(java.io.File) ExternalResourceRepository(org.gradle.internal.resource.ExternalResourceRepository)

Aggregations

URI (java.net.URI)3 ExternalResourceRepository (org.gradle.internal.resource.ExternalResourceRepository)3 RepositoryTransport (org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport)2 ImmutableList (com.google.common.collect.ImmutableList)1 File (java.io.File)1 IOException (java.io.IOException)1 UncheckedIOException (java.io.UncheckedIOException)1 Collections (java.util.Collections)1 List (java.util.List)1 Set (java.util.Set)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 PGPException (org.bouncycastle.openpgp.PGPException)1 PGPPublicKey (org.bouncycastle.openpgp.PGPPublicKey)1 PGPPublicKeyRing (org.bouncycastle.openpgp.PGPPublicKeyRing)1 PGPSignature (org.bouncycastle.openpgp.PGPSignature)1 PGPSignatureList (org.bouncycastle.openpgp.PGPSignatureList)1 DefaultMavenArtifactRepository (org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository)1 RepositoryTransportFactory (org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransportFactory)1 InMemoryCacheDecoratorFactory (org.gradle.cache.internal.InMemoryCacheDecoratorFactory)1 BuildScopedCache (org.gradle.cache.scopes.BuildScopedCache)1