Class BannedDependencies
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
org.apache.maven.enforcer.rules.dependency.BannedDependenciesBase
org.apache.maven.enforcer.rules.dependency.BannedDependencies
- All Implemented Interfaces:
EnforcerRuleBase
This rule checks that lists of dependencies are not included.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBannedDependencies(org.apache.maven.execution.MavenSession session, ResolverUtil resolverUtil) -
Method Summary
Methods inherited from class BannedDependenciesBase
getExcludes, getIncludes, getSession, isSearchTransitive, setExcludes, setIncludes, setSearchTransitive, validateMethods inherited from class AbstractStandardEnforcerRule
formatLocation, getMessage, setMessageMethods inherited from class AbstractEnforcerRule
getCacheId, getLevel, getRuleNameMethods inherited from class AbstractEnforcerRuleBase
getLog, setLog
-
Field Details
-
shouldExclude
-
shouldInclude
-
-
Constructor Details
-
BannedDependencies
@Inject BannedDependencies(org.apache.maven.execution.MavenSession session, ResolverUtil resolverUtil)
-
-
Method Details
-
execute
Description copied from class:AbstractEnforcerRuleThis is the interface into the rule. This method should throw an exception containing a reason message if the rule fails the check. The plugin will then decide based on the fail flag and rule level if it should stop or just log the message as a warning.- Overrides:
executein classBannedDependenciesBase- Throws:
EnforcerRuleException- the enforcer rule exception
-
validate
protected boolean validate(org.apache.maven.artifact.Artifact artifact) Description copied from class:BannedDependenciesBaseValidates a dependency artifact if it fulfills the enforcer rule- Specified by:
validatein classBannedDependenciesBase- Parameters:
artifact- dependency to be checked against the list of excludes- Returns:
trueif the dependency passes the rule,falseif the dependency triggers a validation error
-
getErrorMessage
- Specified by:
getErrorMessagein classBannedDependenciesBase
-
toString
-