use of org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata in project gradle by gradle.
the class MavenLocalResolver method isOrphanedPom.
private boolean isOrphanedPom(MutableMavenModuleResolveMetadata metaData, ExternalResourceArtifactResolver artifactResolver) {
if (metaData.isPomPackaging()) {
return false;
}
// check custom packaging
ModuleComponentArtifactMetadata artifact;
if (metaData.isKnownJarPackaging()) {
artifact = metaData.artifact("jar", "jar", null);
} else {
artifact = metaData.artifact(metaData.getPackaging(), metaData.getPackaging(), null);
}
if (artifactResolver.artifactExists(artifact, new DefaultResourceAwareResolveResult())) {
return false;
}
LOGGER.debug("POM file found for module '{}' in repository '{}' but no artifact found. Ignoring.", metaData.getId(), getName());
return true;
}
use of org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata in project gradle by gradle.
the class LocallyAvailableResourceFinderFactory method create.
public LocallyAvailableResourceFinder<ModuleComponentArtifactMetadata> create() {
List<LocallyAvailableResourceFinder<ModuleComponentArtifactMetadata>> finders = new LinkedList<LocallyAvailableResourceFinder<ModuleComponentArtifactMetadata>>();
// Order is important here, because they will be searched in that order
// The current filestore
finders.add(new LocallyAvailableResourceFinderSearchableFileStoreAdapter<ModuleComponentArtifactMetadata>(new FileStoreSearcher<ModuleComponentArtifactMetadata>() {
@Override
public Set<? extends LocallyAvailableResource> search(ModuleComponentArtifactMetadata key) {
return fileStore.search(key.getId());
}
}));
// 1.8
addForPattern(finders, "artifacts-26/filestore/[organisation]/[module](/[branch])/[revision]/[type]/*/[artifact]-[revision](-[classifier])(.[ext])");
// 1.5
addForPattern(finders, "artifacts-24/filestore/[organisation]/[module](/[branch])/[revision]/[type]/*/[artifact]-[revision](-[classifier])(.[ext])");
// 1.4
addForPattern(finders, "artifacts-23/filestore/[organisation]/[module](/[branch])/[revision]/[type]/*/[artifact]-[revision](-[classifier])(.[ext])");
// 1.3
addForPattern(finders, "artifacts-15/filestore/[organisation]/[module](/[branch])/[revision]/[type]/*/[artifact]-[revision](-[classifier])(.[ext])");
// 1.1, 1.2
addForPattern(finders, "artifacts-14/filestore/[organisation]/[module](/[branch])/[revision]/[type]/*/[artifact]-[revision](-[classifier])(.[ext])");
// rc-1, 1.0
addForPattern(finders, "artifacts-13/filestore/[organisation]/[module](/[branch])/[revision]/[type]/*/[artifact]-[revision](-[classifier])(.[ext])");
// Milestone 8 and 9
addForPattern(finders, "artifacts-8/filestore/[organisation]/[module](/[branch])/[revision]/[type]/*/[artifact]-[revision](-[classifier])(.[ext])");
// Milestone 7
addForPattern(finders, "artifacts-7/artifacts/*/[organisation]/[module](/[branch])/[revision]/[type]/[artifact]-[revision](-[classifier])(.[ext])");
// Milestone 6
addForPattern(finders, "artifacts-4/[organisation]/[module](/[branch])/*/[type]s/[artifact]-[revision](-[classifier])(.[ext])");
addForPattern(finders, "artifacts-4/[organisation]/[module](/[branch])/*/pom.originals/[artifact]-[revision](-[classifier])(.[ext])");
// Milestone 3
addForPattern(finders, "../cache/[organisation]/[module](/[branch])/[type]s/[artifact]-[revision](-[classifier])(.[ext])");
// Maven local
try {
File localMavenRepository = localMavenRepositoryLocator.getLocalMavenRepository();
if (localMavenRepository.exists()) {
addForPattern(finders, localMavenRepository, new M2ResourcePattern("[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier])(.[ext])"));
}
} catch (CannotLocateLocalMavenRepositoryException ex) {
finders.add(new NoMavenLocalRepositoryResourceFinder(ex));
}
return new CompositeLocallyAvailableResourceFinder<ModuleComponentArtifactMetadata>(finders);
}
use of org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata in project gradle by gradle.
the class AbstractRepositoryMetadataSource method parseMetaDataFromArtifact.
@Nullable
private S parseMetaDataFromArtifact(String repositoryName, ComponentResolvers componentResolvers, ModuleComponentIdentifier moduleComponentIdentifier, ExternalResourceArtifactResolver artifactResolver, ResourceAwareResolveResult result) {
ModuleComponentArtifactMetadata artifact = getMetaDataArtifactFor(moduleComponentIdentifier);
LocallyAvailableExternalResource metadataArtifact = artifactResolver.resolveArtifact(artifact, result);
if (metadataArtifact != null) {
ExternalResourceResolverDescriptorParseContext context = new ExternalResourceResolverDescriptorParseContext(componentResolvers, fileResourceRepository);
return parseMetaDataFromResource(moduleComponentIdentifier, metadataArtifact, artifactResolver, context, repositoryName);
}
return null;
}
Aggregations