Package org.apache.maven.plugin.internal
Class PluginDependencyResolutionListener
java.lang.Object
org.apache.maven.plugin.internal.PluginDependencyResolutionListener
- All Implemented Interfaces:
ResolutionListener
Assists in detecting wagon providers brought into the plugin class path via legacy Maven core artifacts (e.g.
maven-core:2.0.6) and excluding them. A plugin should be able to explicitly declare dependencies on specific wagons
for its use. However, the (old) wagons pulled in transitively via legacy Maven core artifacts are usually not
intended as dependencies and more importantly screw up artifact resolution because they would get preferred over the
core wagon versions. This is a hack to provide backward-compat with Maven 2 (MNG-4528, MNG-4561).
- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LinkedList<Artifact>
private ArtifactFilter
private Artifact
Fields inherited from interface org.apache.maven.artifact.resolver.ResolutionListener
FINISH_PROCESSING_CHILDREN, INCLUDE_ARTIFACT, MANAGE_ARTIFACT, MANAGE_ARTIFACT_SCOPE, MANAGE_ARTIFACT_SYSTEM_PATH, MANAGE_ARTIFACT_VERSION, OMIT_FOR_CYCLE, OMIT_FOR_NEARER, PROCESS_CHILDREN, RESTRICT_RANGE, ROLE, SELECT_VERSION_FROM_RANGE, TEST_ARTIFACT, UPDATE_SCOPE, UPDATE_SCOPE_CURRENT_POM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
endProcessChildren
(Artifact artifact) void
includeArtifact
(Artifact artifact) private boolean
isLegacyCoreArtifact
(Artifact artifact) private boolean
isWagonProvider
(Artifact artifact) void
manageArtifact
(Artifact artifact, Artifact replacement) void
omitForCycle
(Artifact artifact) void
omitForNearer
(Artifact omitted, Artifact kept) void
removeBannedDependencies
(Collection<Artifact> artifacts) void
restrictRange
(Artifact artifact, Artifact replacement, VersionRange newRange) void
selectVersionFromRange
(Artifact artifact) void
startProcessChildren
(Artifact artifact) void
testArtifact
(Artifact node) void
updateScope
(Artifact artifact, String scope) void
updateScopeCurrentPom
(Artifact artifact, String ignoredScope) This event means that the artifactScope has NOT been updated to a farther node artifactScope because current node is in the first level pom
-
Field Details
-
coreFilter
-
coreArtifacts
-
wagonProvider
-
bannedArtifacts
-
-
Constructor Details
-
PluginDependencyResolutionListener
PluginDependencyResolutionListener(ArtifactFilter coreFilter)
-
-
Method Details
-
removeBannedDependencies
-
startProcessChildren
- Specified by:
startProcessChildren
in interfaceResolutionListener
-
isLegacyCoreArtifact
-
endProcessChildren
- Specified by:
endProcessChildren
in interfaceResolutionListener
-
includeArtifact
- Specified by:
includeArtifact
in interfaceResolutionListener
-
isWagonProvider
-
manageArtifact
- Specified by:
manageArtifact
in interfaceResolutionListener
-
omitForCycle
- Specified by:
omitForCycle
in interfaceResolutionListener
-
omitForNearer
- Specified by:
omitForNearer
in interfaceResolutionListener
-
restrictRange
- Specified by:
restrictRange
in interfaceResolutionListener
-
selectVersionFromRange
- Specified by:
selectVersionFromRange
in interfaceResolutionListener
-
testArtifact
- Specified by:
testArtifact
in interfaceResolutionListener
-
updateScope
- Specified by:
updateScope
in interfaceResolutionListener
-
updateScopeCurrentPom
Description copied from interface:ResolutionListener
This event means that the artifactScope has NOT been updated to a farther node artifactScope because current node is in the first level pom- Specified by:
updateScopeCurrentPom
in interfaceResolutionListener
- Parameters:
artifact
- current node artifact, the one in the first level pomignoredScope
- artifactScope that was ignored because artifact was in first level pom
-