Search in sources :

Example 1 with MavenMetadataLoader

use of org.gradle.api.internal.artifacts.repositories.maven.MavenMetadataLoader 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);
    return new MavenResolver(getName(), rootUri, transport, locallyAvailableResourceFinder, artifactFileStore, moduleIdentifierFactory, metadataSources, MavenMetadataArtifactProvider.INSTANCE, mavenMetadataLoader);
}
Also used : MavenResolver(org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver) ImmutableMetadataSources(org.gradle.api.internal.artifacts.repositories.metadata.ImmutableMetadataSources) DefaultImmutableMetadataSources(org.gradle.api.internal.artifacts.repositories.metadata.DefaultImmutableMetadataSources) RepositoryTransport(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport) MavenMetadataLoader(org.gradle.api.internal.artifacts.repositories.maven.MavenMetadataLoader)

Example 2 with MavenMetadataLoader

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

the class DefaultMavenLocalArtifactRepository method createRealResolver.

protected MavenResolver createRealResolver() {
    URI rootUri = getUrl();
    if (rootUri == null) {
        throw new InvalidUserDataException("You must specify a URL for a Maven repository.");
    }
    RepositoryTransport transport = getTransport(rootUri.getScheme());
    MavenMetadataLoader mavenMetadataLoader = new MavenMetadataLoader(transport.getResourceAccessor(), getResourcesFileStore());
    MavenResolver resolver = new MavenResolver(getName(), rootUri, transport, getLocallyAvailableResourceFinder(), getArtifactFileStore(), moduleIdentifierFactory, createMetadataSources(mavenMetadataLoader), MavenMetadataArtifactProvider.INSTANCE, mavenMetadataLoader);
    for (URI repoUrl : getArtifactUrls()) {
        resolver.addArtifactLocation(repoUrl);
    }
    return resolver;
}
Also used : InvalidUserDataException(org.gradle.api.InvalidUserDataException) MavenResolver(org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver) RepositoryTransport(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport) MavenMetadataLoader(org.gradle.api.internal.artifacts.repositories.maven.MavenMetadataLoader) URI(java.net.URI)

Aggregations

MavenMetadataLoader (org.gradle.api.internal.artifacts.repositories.maven.MavenMetadataLoader)2 MavenResolver (org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver)2 RepositoryTransport (org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport)2 URI (java.net.URI)1 InvalidUserDataException (org.gradle.api.InvalidUserDataException)1 DefaultImmutableMetadataSources (org.gradle.api.internal.artifacts.repositories.metadata.DefaultImmutableMetadataSources)1 ImmutableMetadataSources (org.gradle.api.internal.artifacts.repositories.metadata.ImmutableMetadataSources)1