use of org.gradle.internal.component.external.model.maven.MutableMavenModuleResolveMetadata in project gradle by gradle.
the class MavenMutableModuleMetadataFactory method missing.
@Override
public MutableMavenModuleResolveMetadata missing(ModuleComponentIdentifier from) {
MutableMavenModuleResolveMetadata metadata = create(from, Collections.emptyList());
metadata.setMissing(true);
return MavenResolver.processMetaData(metadata);
}
use of org.gradle.internal.component.external.model.maven.MutableMavenModuleResolveMetadata in project gradle by gradle.
the class GradlePomModuleDescriptorParser method doParseDescriptor.
@Override
protected ParseResult<MutableMavenModuleResolveMetadata> doParseDescriptor(DescriptorParseContext parserSettings, LocallyAvailableExternalResource resource, boolean validate) throws IOException, ParseException, SAXException {
PomReader pomReader = new PomReader(resource, moduleIdentifierFactory);
GradlePomModuleDescriptorBuilder mdBuilder = new GradlePomModuleDescriptorBuilder(pomReader, gradleVersionSelectorScheme, mavenVersionSelectorScheme);
doParsePom(parserSettings, mdBuilder, pomReader);
List<MavenDependencyDescriptor> dependencies = mdBuilder.getDependencies();
ModuleComponentIdentifier cid = mdBuilder.getComponentIdentifier();
MutableMavenModuleResolveMetadata metadata = metadataFactory.create(cid, dependencies);
metadata.setStatus(mdBuilder.getStatus());
if (pomReader.getRelocation() != null) {
metadata.setPackaging("pom");
metadata.setRelocated(true);
} else {
metadata.setPackaging(pomReader.getPackaging());
metadata.setRelocated(false);
}
return ParseResult.of(metadata, pomReader.hasGradleMetadataMarker());
}
use of org.gradle.internal.component.external.model.maven.MutableMavenModuleResolveMetadata in project gradle by gradle.
the class DefaultMavenPomMetadataSource method parseMetaDataFromResource.
@Override
protected MetaDataParser.ParseResult<MutableMavenModuleResolveMetadata> parseMetaDataFromResource(ModuleComponentIdentifier moduleComponentIdentifier, LocallyAvailableExternalResource cachedResource, ExternalResourceArtifactResolver artifactResolver, DescriptorParseContext context, String repoName) {
MetaDataParser.ParseResult<MutableMavenModuleResolveMetadata> parseResult = pomParser.parseMetaData(context, cachedResource);
MutableMavenModuleResolveMetadata metaData = parseResult.getResult();
if (metaData != null) {
if (moduleComponentIdentifier instanceof MavenUniqueSnapshotComponentIdentifier) {
// Snapshot POMs use -SNAPSHOT instead of the timestamp as version, so validate against the expected id
MavenUniqueSnapshotComponentIdentifier snapshotComponentIdentifier = (MavenUniqueSnapshotComponentIdentifier) moduleComponentIdentifier;
checkMetadataConsistency(snapshotComponentIdentifier.getSnapshotComponent(), metaData);
metaData.setId(snapshotComponentIdentifier);
metaData.setSnapshotTimestamp(snapshotComponentIdentifier.getTimestamp());
} else {
checkMetadataConsistency(moduleComponentIdentifier, metaData);
}
MutableMavenModuleResolveMetadata result = MavenResolver.processMetaData(metaData);
result.getSources().add(new ModuleDescriptorHashModuleSource(checksumService.md5(cachedResource.getFile()), metaData.isChanging()));
if (validator.isUsableModule(repoName, result, artifactResolver)) {
return parseResult;
}
return null;
}
return parseResult;
}
Aggregations