-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MDEP-940] Use Resolver API instead of m-a-t for resolving artifacts
- Loading branch information
1 parent
8e1f1b5
commit 82a9d60
Showing
9 changed files
with
89 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ | |
|
||
import org.apache.maven.artifact.Artifact; | ||
import org.apache.maven.plugin.logging.Log; | ||
import org.apache.maven.shared.transfer.artifact.ArtifactCoordinate; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Brian Fox</a> | ||
|
@@ -31,7 +30,7 @@ public interface ArtifactTranslator { | |
/** | ||
* @param artifacts set of {@link Artifact}s. | ||
* @param log {@link Log} | ||
* @return {@link ArtifactCoordinate} | ||
* @return set of {@link org.eclipse.aether.artifact.Artifact} | ||
*/ | ||
Set<ArtifactCoordinate> translate(Set<Artifact> artifacts, Log log); | ||
Set<org.eclipse.aether.artifact.Artifact> translate(Set<Artifact> artifacts, Log log); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,12 +21,12 @@ | |
import java.util.LinkedHashSet; | ||
import java.util.Set; | ||
|
||
import org.apache.maven.RepositoryUtils; | ||
import org.apache.maven.artifact.Artifact; | ||
import org.apache.maven.artifact.handler.ArtifactHandler; | ||
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; | ||
import org.apache.maven.plugin.logging.Log; | ||
import org.apache.maven.shared.transfer.artifact.ArtifactCoordinate; | ||
import org.apache.maven.shared.transfer.artifact.DefaultArtifactCoordinate; | ||
import org.eclipse.aether.util.artifact.SubArtifact; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Brian Fox</a> | ||
|
@@ -39,13 +39,13 @@ public class ClassifierTypeTranslator implements ArtifactTranslator { | |
private String type; | ||
|
||
/** | ||
* @param artifactHanderManager {@link ArtifactHandlerManager}. | ||
* @param artifactHandlerManager {@link ArtifactHandlerManager}. | ||
* @param theClassifier The classifier to use. | ||
* @param theType The type. | ||
*/ | ||
public ClassifierTypeTranslator( | ||
ArtifactHandlerManager artifactHanderManager, String theClassifier, String theType) { | ||
this.artifactHandlerManager = artifactHanderManager; | ||
ArtifactHandlerManager artifactHandlerManager, String theClassifier, String theType) { | ||
this.artifactHandlerManager = artifactHandlerManager; | ||
this.classifier = theClassifier; | ||
this.type = theType; | ||
} | ||
|
@@ -56,8 +56,8 @@ public ClassifierTypeTranslator( | |
* org.apache.maven.plugin.logging.Log) | ||
*/ | ||
@Override | ||
public Set<ArtifactCoordinate> translate(Set<Artifact> artifacts, Log log) { | ||
Set<ArtifactCoordinate> results; | ||
public Set<org.eclipse.aether.artifact.Artifact> translate(Set<Artifact> artifacts, Log log) { | ||
Set<org.eclipse.aether.artifact.Artifact> results; | ||
|
||
log.debug("Translating Artifacts using Classifier: " + this.classifier + " and Type: " + this.type); | ||
results = new LinkedHashSet<>(); | ||
|
@@ -88,30 +88,7 @@ public Set<ArtifactCoordinate> translate(Set<Artifact> artifacts, Log log) { | |
useClassifier = artifact.getClassifier(); | ||
} | ||
|
||
DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate(); | ||
coordinate.setGroupId(artifact.getGroupId()); | ||
coordinate.setArtifactId(artifact.getArtifactId()); | ||
coordinate.setVersion(artifact.getVersion()); | ||
coordinate.setClassifier(useClassifier); | ||
coordinate.setExtension(extension); | ||
|
||
// // Create a new artifact | ||
// Artifact newArtifact = factory.createArtifactWithClassifier( artifact.getGroupId(), artifact | ||
// .getArtifactId(), artifact.getVersion(), useType, useClassifier ); | ||
// | ||
// // note the new artifacts will always have the scope set to null. We | ||
// // should | ||
// // reset it here so that it will pass other filters if needed | ||
// newArtifact.setScope( artifact.getScope() ); | ||
// | ||
// if ( Artifact.SCOPE_SYSTEM.equals( newArtifact.getScope() ) ) | ||
// { | ||
// File baseDir = repositoryManager.getLocalRepositoryBasedir( buildingRequest ); | ||
// String path = repositoryManager.getPathForLocalArtifact( buildingRequest, newArtifact ); | ||
// newArtifact.setFile( new File( baseDir, path ) ); | ||
// } | ||
|
||
results.add(coordinate); | ||
results.add(new SubArtifact(RepositoryUtils.toArtifact(artifact), useClassifier, extension)); | ||
} | ||
|
||
return results; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.