Package org.apache.maven.plugin.internal
Class PluginDependencyResolutionListener
- java.lang.Object
-
- org.apache.maven.plugin.internal.PluginDependencyResolutionListener
-
- All Implemented Interfaces:
ResolutionListener
class PluginDependencyResolutionListener extends java.lang.Object implements 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
Fields Modifier and Type Field Description private java.util.Map<Artifact,java.lang.Object>bannedArtifactsprivate java.util.LinkedList<Artifact>coreArtifactsprivate ArtifactFiltercoreFilterprivate ArtifactwagonProvider-
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 Constructor Description PluginDependencyResolutionListener(ArtifactFilter coreFilter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendProcessChildren(Artifact artifact)voidincludeArtifact(Artifact artifact)private booleanisLegacyCoreArtifact(Artifact artifact)private booleanisWagonProvider(Artifact artifact)voidmanageArtifact(Artifact artifact, Artifact replacement)voidomitForCycle(Artifact artifact)voidomitForNearer(Artifact omitted, Artifact kept)voidremoveBannedDependencies(java.util.Collection<Artifact> artifacts)voidrestrictRange(Artifact artifact, Artifact replacement, VersionRange newRange)voidselectVersionFromRange(Artifact artifact)voidstartProcessChildren(Artifact artifact)voidtestArtifact(Artifact node)voidupdateScope(Artifact artifact, java.lang.String scope)voidupdateScopeCurrentPom(Artifact artifact, java.lang.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 Detail
-
coreFilter
private ArtifactFilter coreFilter
-
coreArtifacts
private java.util.LinkedList<Artifact> coreArtifacts
-
wagonProvider
private Artifact wagonProvider
-
bannedArtifacts
private java.util.Map<Artifact,java.lang.Object> bannedArtifacts
-
-
Constructor Detail
-
PluginDependencyResolutionListener
PluginDependencyResolutionListener(ArtifactFilter coreFilter)
-
-
Method Detail
-
removeBannedDependencies
public void removeBannedDependencies(java.util.Collection<Artifact> artifacts)
-
startProcessChildren
public void startProcessChildren(Artifact artifact)
- Specified by:
startProcessChildrenin interfaceResolutionListener
-
isLegacyCoreArtifact
private boolean isLegacyCoreArtifact(Artifact artifact)
-
endProcessChildren
public void endProcessChildren(Artifact artifact)
- Specified by:
endProcessChildrenin interfaceResolutionListener
-
includeArtifact
public void includeArtifact(Artifact artifact)
- Specified by:
includeArtifactin interfaceResolutionListener
-
isWagonProvider
private boolean isWagonProvider(Artifact artifact)
-
manageArtifact
public void manageArtifact(Artifact artifact, Artifact replacement)
- Specified by:
manageArtifactin interfaceResolutionListener
-
omitForCycle
public void omitForCycle(Artifact artifact)
- Specified by:
omitForCyclein interfaceResolutionListener
-
omitForNearer
public void omitForNearer(Artifact omitted, Artifact kept)
- Specified by:
omitForNearerin interfaceResolutionListener
-
restrictRange
public void restrictRange(Artifact artifact, Artifact replacement, VersionRange newRange)
- Specified by:
restrictRangein interfaceResolutionListener
-
selectVersionFromRange
public void selectVersionFromRange(Artifact artifact)
- Specified by:
selectVersionFromRangein interfaceResolutionListener
-
testArtifact
public void testArtifact(Artifact node)
- Specified by:
testArtifactin interfaceResolutionListener
-
updateScope
public void updateScope(Artifact artifact, java.lang.String scope)
- Specified by:
updateScopein interfaceResolutionListener
-
updateScopeCurrentPom
public void updateScopeCurrentPom(Artifact artifact, java.lang.String ignoredScope)
Description copied from interface:ResolutionListenerThis 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:
updateScopeCurrentPomin interfaceResolutionListener- Parameters:
artifact- current node artifact, the one in the first level pomignoredScope- artifactScope that was ignored because artifact was in first level pom
-
-