Search in sources :

Example 1 with ArtifactResolveException

use of org.gradle.internal.resolve.ArtifactResolveException in project gradle by gradle.

the class ExternalResourceResolver method resolveArtifact.

protected void resolveArtifact(ComponentArtifactMetadata componentArtifact, ModuleSource moduleSource, BuildableArtifactResolveResult result) {
    ModuleComponentArtifactMetadata artifact = (ModuleComponentArtifactMetadata) componentArtifact;
    File localFile;
    try {
        localFile = download(artifact, moduleSource, result);
    } catch (Throwable e) {
        result.failed(new ArtifactResolveException(artifact.getId(), e));
        return;
    }
    if (localFile != null) {
        result.resolved(localFile);
    } else {
        result.notFound(artifact.getId());
    }
}
Also used : ArtifactResolveException(org.gradle.internal.resolve.ArtifactResolveException) DefaultModuleComponentArtifactMetadata(org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata) ModuleComponentArtifactMetadata(org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata) File(java.io.File)

Aggregations

File (java.io.File)1 DefaultModuleComponentArtifactMetadata (org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata)1 ModuleComponentArtifactMetadata (org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata)1 ArtifactResolveException (org.gradle.internal.resolve.ArtifactResolveException)1