Class AbstractBanDependencies
- java.lang.Object
-
- org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule
-
- org.apache.maven.plugins.enforcer.AbstractNonCacheableEnforcerRule
-
- org.apache.maven.plugins.enforcer.AbstractBanDependencies
-
- All Implemented Interfaces:
EnforcerRule,EnforcerRule2
- Direct Known Subclasses:
BannedDependencies,NoSnapshots,RequireReleaseDeps
public abstract class AbstractBanDependencies extends AbstractNonCacheableEnforcerRule
Abstract Rule for banning dependencies.- Version:
- $Id: AbstractBanDependencies.java 1630934 2014-10-10 16:35:26Z khmarbaise $
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.maven.shared.dependency.graph.DependencyGraphBuildergraphBuilderprivate booleansearchTransitiveSpecify if transitive dependencies should be searched (default) or only look at direct dependencies.
-
Constructor Summary
Constructors Constructor Description AbstractBanDependencies()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.util.Set<org.apache.maven.artifact.Artifact>checkDependencies(java.util.Set<org.apache.maven.artifact.Artifact> dependencies, org.apache.maven.plugin.logging.Log log)Checks the set of dependencies against the list of excludes.voidexecute(EnforcerRuleHelper helper)Execute the rule.private java.util.Set<org.apache.maven.artifact.Artifact>getAllDescendants(org.apache.maven.shared.dependency.graph.DependencyNode node)protected java.util.Set<org.apache.maven.artifact.Artifact>getDependenciesToCheck(org.apache.maven.project.ProjectBuildingRequest projectBuildingRequest)protected java.lang.CharSequencegetErrorMessage(org.apache.maven.artifact.Artifact artifact)booleanisSearchTransitive()Checks if is search transitive.voidsetSearchTransitive(boolean theSearchTransitive)Sets the search transitive.-
Methods inherited from class org.apache.maven.plugins.enforcer.AbstractNonCacheableEnforcerRule
getCacheId, isCacheable, isResultValid
-
Methods inherited from class org.apache.maven.plugins.enforcer.AbstractStandardEnforcerRule
getLevel, getMessage, setLevel, setMessage
-
-
-
-
Method Detail
-
execute
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException
Execute the rule.- Parameters:
helper- the helper- Throws:
EnforcerRuleException- the enforcer rule exception
-
getErrorMessage
protected java.lang.CharSequence getErrorMessage(org.apache.maven.artifact.Artifact artifact)
-
getDependenciesToCheck
protected java.util.Set<org.apache.maven.artifact.Artifact> getDependenciesToCheck(org.apache.maven.project.ProjectBuildingRequest projectBuildingRequest)
-
getAllDescendants
private java.util.Set<org.apache.maven.artifact.Artifact> getAllDescendants(org.apache.maven.shared.dependency.graph.DependencyNode node)
-
checkDependencies
protected abstract java.util.Set<org.apache.maven.artifact.Artifact> checkDependencies(java.util.Set<org.apache.maven.artifact.Artifact> dependencies, org.apache.maven.plugin.logging.Log log) throws EnforcerRuleExceptionChecks the set of dependencies against the list of excludes.- Parameters:
dependencies- the dependencieslog- the log- Returns:
- the sets the
- Throws:
EnforcerRuleException- the enforcer rule exception
-
isSearchTransitive
public boolean isSearchTransitive()
Checks if is search transitive.- Returns:
- the searchTransitive
-
setSearchTransitive
public void setSearchTransitive(boolean theSearchTransitive)
Sets the search transitive.- Parameters:
theSearchTransitive- the searchTransitive to set
-
-