in src/main/java/org/apache/sling/cpconverter/maven/mojos/ContentPackage.java [132:157]
private Artifact resolveArtifact(final RepositorySystem repoSystem, final RepositorySystemSession repoSession,
final List<RemoteRepository> remoteRepos, final Artifact artifact) {
try {
// Get an Aether Artifact
org.eclipse.aether.artifact.Artifact a = new org.eclipse.aether.artifact.DefaultArtifact(
artifact.getGroupId(), artifact.getArtifactId(),
artifact.getClassifier(), artifact.getType(),
artifact.getVersion());
ArtifactRequest req = new ArtifactRequest(a, remoteRepos, null);
ArtifactResult res = repoSystem.resolveArtifact(repoSession, req);
if (res.isResolved()) {
org.eclipse.aether.artifact.Artifact aetherArt = res.getArtifact();
Artifact mavenArt = new DefaultArtifact(
aetherArt.getGroupId(), aetherArt.getArtifactId(), aetherArt.getVersion(), null, aetherArt.getExtension(),
aetherArt.getClassifier(), new DefaultArtifactHandler());
mavenArt.setFile(aetherArt.getFile());
return mavenArt;
} else {
return null;
}
} catch (RepositoryException e) {
throw new RuntimeException(e);
}
}