use of org.gradle.api.internal.artifacts.repositories.resolver.ResourcePattern in project gradle by gradle.
the class MavenVersionLister method listVersions.
public void listVersions(ModuleIdentifier module, List<ResourcePattern> patterns, BuildableModuleVersionListingResolveResult result) {
final Set<ExternalResourceName> searched = Sets.newHashSet();
List<String> versions = Lists.newArrayList();
boolean hasResult = false;
for (ResourcePattern pattern : patterns) {
ExternalResourceName metadataLocation = pattern.toModulePath(module).resolve("maven-metadata.xml");
if (searched.add(metadataLocation)) {
result.attempted(metadataLocation);
try {
MavenMetadata mavenMetaData = mavenMetadataLoader.load(metadataLocation);
versions.addAll(mavenMetaData.versions);
hasResult = true;
} catch (MissingResourceException e) {
// Continue
}
}
}
if (hasResult) {
result.listed(versions);
}
}
Aggregations