Search in sources :

Example 1 with RepositoryTransport

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

the class DefaultMavenArtifactRepository method createResolver.

private MavenResolver createResolver(URI rootUri) {
    RepositoryTransport transport = getTransport(rootUri.getScheme());
    MavenMetadataLoader mavenMetadataLoader = new MavenMetadataLoader(transport.getResourceAccessor(), resourcesFileStore);
    ImmutableMetadataSources metadataSources = createMetadataSources(mavenMetadataLoader);
    Instantiator injector = createInjectorForMetadataSuppliers(transport, instantiatorFactory, getUrl(), resourcesFileStore);
    InstantiatingAction<ComponentMetadataSupplierDetails> supplier = createComponentMetadataSupplierFactory(injector, isolatableFactory);
    InstantiatingAction<ComponentMetadataListerDetails> lister = createComponentMetadataVersionLister(injector, isolatableFactory);
    return new MavenResolver(getName(), rootUri, transport, locallyAvailableResourceFinder, artifactFileStore, metadataSources, MavenMetadataArtifactProvider.INSTANCE, mavenMetadataLoader, supplier, lister, injector, checksumService);
}
Also used : MavenResolver(org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver) ComponentMetadataSupplierDetails(org.gradle.api.artifacts.ComponentMetadataSupplierDetails) Instantiator(org.gradle.internal.reflect.Instantiator) DefaultImmutableMetadataSources(org.gradle.api.internal.artifacts.repositories.metadata.DefaultImmutableMetadataSources) ImmutableMetadataSources(org.gradle.api.internal.artifacts.repositories.metadata.ImmutableMetadataSources) RepositoryTransport(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport) MavenMetadataLoader(org.gradle.api.internal.artifacts.repositories.maven.MavenMetadataLoader) ComponentMetadataListerDetails(org.gradle.api.artifacts.ComponentMetadataListerDetails)

Example 2 with RepositoryTransport

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

the class DefaultMavenLocalArtifactRepository method createRealResolver.

@Override
protected MavenResolver createRealResolver() {
    URI rootUri = validateUrl();
    RepositoryTransport transport = getTransport(rootUri.getScheme());
    MavenMetadataLoader mavenMetadataLoader = new MavenMetadataLoader(transport.getResourceAccessor(), getResourcesFileStore());
    Instantiator injector = createInjectorForMetadataSuppliers(transport, getInstantiatorFactory(), rootUri, getResourcesFileStore());
    MavenResolver resolver = new MavenResolver(getName(), rootUri, transport, getLocallyAvailableResourceFinder(), getArtifactFileStore(), createMetadataSources(mavenMetadataLoader), MavenMetadataArtifactProvider.INSTANCE, mavenMetadataLoader, null, null, injector, checksumService);
    for (URI repoUrl : getArtifactUrls()) {
        resolver.addArtifactLocation(repoUrl);
    }
    return resolver;
}
Also used : MavenResolver(org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver) Instantiator(org.gradle.internal.reflect.Instantiator) RepositoryTransport(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport) MavenMetadataLoader(org.gradle.api.internal.artifacts.repositories.maven.MavenMetadataLoader) URI(java.net.URI)

Example 3 with RepositoryTransport

use of org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport 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 4 with RepositoryTransport

use of org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport 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 5 with RepositoryTransport

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

the class DependencyManagementBuildScopeServices method createTextResourceLoader.

TextResourceLoader createTextResourceLoader(ExternalResourceFileStore resourceFileStore, RepositoryTransportFactory repositoryTransportFactory) {
    HashSet<String> schemas = Sets.newHashSet("https", "http");
    RepositoryTransport transport = repositoryTransportFactory.createTransport(schemas, "http auth", Collections.<Authentication>emptyList());
    ExternalResourceAccessor externalResourceAccessor = new DefaultExternalResourceAccessor(resourceFileStore, transport.getResourceAccessor());
    return new DefaultUriTextResourceLoader(externalResourceAccessor, schemas);
}
Also used : DefaultExternalResourceAccessor(org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceAccessor) DefaultUriTextResourceLoader(org.gradle.internal.resource.transfer.DefaultUriTextResourceLoader) ExternalResourceAccessor(org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceAccessor) DefaultExternalResourceAccessor(org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceAccessor) RepositoryTransport(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport)

Aggregations

RepositoryTransport (org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport)6 URI (java.net.URI)3 Instantiator (org.gradle.internal.reflect.Instantiator)3 MavenMetadataLoader (org.gradle.api.internal.artifacts.repositories.maven.MavenMetadataLoader)2 MavenResolver (org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver)2 ExternalResourceRepository (org.gradle.internal.resource.ExternalResourceRepository)2 File (java.io.File)1 InvalidUserDataException (org.gradle.api.InvalidUserDataException)1 ComponentMetadataListerDetails (org.gradle.api.artifacts.ComponentMetadataListerDetails)1 ComponentMetadataSupplierDetails (org.gradle.api.artifacts.ComponentMetadataSupplierDetails)1 DefaultMavenArtifactRepository (org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository)1 DefaultImmutableMetadataSources (org.gradle.api.internal.artifacts.repositories.metadata.DefaultImmutableMetadataSources)1 ImmutableMetadataSources (org.gradle.api.internal.artifacts.repositories.metadata.ImmutableMetadataSources)1 DefaultExternalResourceAccessor (org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceAccessor)1 ExternalResourceAccessor (org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceAccessor)1 IvyResolver (org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver)1 DefaultUriTextResourceLoader (org.gradle.internal.resource.transfer.DefaultUriTextResourceLoader)1