final CachingModuleSource cachingModuleSource = (CachingModuleSource) moduleSource;
delegate.getRemoteAccess().resolveArtifact(artifact, cachingModuleSource.getDelegate(), result);
LOGGER.debug("Downloaded artifact '{}' from resolver: {}", artifact, delegate.getName());
ArtifactResolveException failure = result.getFailure();
if (failure == null) {
artifactAtRepositoryCachedResolutionIndex.store(artifactCacheKey(artifact), result.getFile(), cachingModuleSource.getDescriptorHash());
} else if (failure instanceof ArtifactNotFoundException) {
artifactAtRepositoryCachedResolutionIndex.storeMissing(artifactCacheKey(artifact), result.getAttempted(), cachingModuleSource.getDescriptorHash());
}