public class ArtifactTransitivityFilter extends AbstractArtifactsFilter
Constructor and Description |
---|
ArtifactTransitivityFilter(Artifact artifact,
ProjectBuildingRequest buildingRequest,
ProjectBuilder projectBuilder)
Use
MavenSession to get the buildingRequest. |
Modifier and Type | Method and Description |
---|---|
boolean |
artifactIsATransitiveDependency(Artifact artifact)
Compares the artifact to the list of dependencies to see if it is directly included by this project
|
Set<Artifact> |
filter(Set<Artifact> artifacts) |
protected static boolean |
isMaven31() |
isArtifactIncluded
public ArtifactTransitivityFilter(Artifact artifact, ProjectBuildingRequest buildingRequest, ProjectBuilder projectBuilder) throws ProjectBuildingException
Use MavenSession
to get the buildingRequest.
The projectBuilder should be resolved with CDI.
// For Mojo @Component private ProjectBuilder projectBuilder; // For Components @Requirement // or @Inject private ProjectBuilder projectBuilder;
artifact
- the artifact to resolve the dependencies frombuildingRequest
- the buildingRequestprojectBuilder
- the projectBuilderProjectBuildingException
- if the project descriptor could not be successfully builtprotected static boolean isMaven31()
public Set<Artifact> filter(Set<Artifact> artifacts)
artifacts
- Artifact
public boolean artifactIsATransitiveDependency(Artifact artifact)
artifact
- representing the item to compare.Copyright © 2002–2015 The Apache Software Foundation. All rights reserved.