List of usage examples for org.apache.maven RepositoryUtils toArtifacts
public static Collection<Artifact> toArtifacts( Collection<org.apache.maven.artifact.Artifact> artifactsToConvert)
From source file:io.takari.maven.workspace.GenerationsWorkspaceReader.java
License:Apache License
private Artifact findMatchingArtifact(MavenProject project, Artifact requestedArtifact) { String versionlessId = ArtifactIdUtils.toVersionlessId(requestedArtifact); Artifact mainArtifact = RepositoryUtils.toArtifact(project.getArtifact()); if (versionlessId.equals(ArtifactIdUtils.toVersionlessId(mainArtifact))) { return mainArtifact; }// w ww .j a va 2 s.c o m for (Artifact attachedArtifact : RepositoryUtils.toArtifacts(project.getAttachedArtifacts())) { if (attachedArtifactComparison(requestedArtifact, attachedArtifact)) { return attachedArtifact; } } return null; }