use of org.sonatype.aether.resolution.ArtifactDescriptorResult in project sonatype-aether by sonatype.
the class IniArtifactDescriptorReader method readArtifactDescriptor.
/**
* Parses the resource <code>$prefix/gid_aid_ext_ver.ini</code> from the request artifact as an artifact description
* and wraps it into an ArtifactDescriptorResult.
*/
public ArtifactDescriptorResult readArtifactDescriptor(RepositorySystemSession session, ArtifactDescriptorRequest request) throws ArtifactDescriptorException {
Artifact artifact = request.getArtifact();
String resourceName = String.format("%s_%s_%s_%s.ini", artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getExtension());
ArtifactDescriptorResult result = new ArtifactDescriptorResult(request);
result.setArtifact(artifact);
try {
ArtifactDescription data = reader.parse(resourceName);
result.setDependencies(data.getDependencies());
result.setManagedDependencies(data.getManagedDependencies());
result.setRepositories(data.getRepositories());
result.setRelocations(data.getRelocations());
return result;
} catch (Exception e) {
throw new ArtifactDescriptorException(result, e.getMessage());
}
}
Aggregations