use of org.gradle.api.internal.artifacts.repositories.maven.MavenMetadata in project gradle by gradle.
the class MavenResolver method findUniqueSnapshotVersion.
@Nullable
private MavenUniqueSnapshotModuleSource findUniqueSnapshotVersion(ModuleComponentIdentifier module, ResourceAwareResolveResult result) {
M2ResourcePattern wholePattern = getWholePattern();
if (!wholePattern.isComplete(module)) {
// do not attempt to download maven-metadata.xml for incomplete identifiers
return null;
}
ExternalResourceName metadataLocation = wholePattern.toModuleVersionPath(module).resolve("maven-metadata.xml");
result.attempted(metadataLocation);
MavenMetadata mavenMetadata = parseMavenMetadata(metadataLocation);
if (mavenMetadata.timestamp != null) {
// we have found a timestamp, so this is a snapshot unique version
String timestamp = mavenMetadata.timestamp + "-" + mavenMetadata.buildNumber;
return new MavenUniqueSnapshotModuleSource(timestamp);
}
return null;
}
Aggregations