Package org.apache.maven.enforcer.rules
Class BanDependencyManagementScope
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
org.apache.maven.enforcer.rules.BanDependencyManagementScope
- All Implemented Interfaces:
EnforcerRuleBase
@Named("banDependencyManagementScope")
public final class BanDependencyManagementScope
extends AbstractStandardEnforcerRule
This rule bans all scope values except for
import
from dependencies within the dependency management.
There is a configuration option to ignore certain dependencies in this check.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
This is the interface into the rule.getLog()
Provide anEnforcerLogger
instance for Ruleprotected List
<org.apache.maven.model.Dependency> getViolatingDependencies
(org.apache.maven.model.DependencyManagement depMgmt) void
setExcludes
(List<String> theExcludes) void
setLog
(EnforcerLogger log) Used byEnforcerMojo
to inject logger instancetoString()
Methods inherited from class org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
formatLocation, getMessage, setMessage
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
getCacheId, getLevel
-
Constructor Details
-
BanDependencyManagementScope
-
-
Method Details
-
execute
Description copied from class:AbstractEnforcerRule
This 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.- Specified by:
execute
in classAbstractEnforcerRule
- Throws:
EnforcerRuleException
- the enforcer rule exception
-
getViolatingDependencies
protected List<org.apache.maven.model.Dependency> getViolatingDependencies(org.apache.maven.model.DependencyManagement depMgmt) -
setExcludes
-
toString
-
setLog
Used byEnforcerMojo
to inject logger instance- Specified by:
setLog
in interfaceEnforcerRuleBase
- Parameters:
log
- anEnforcerLogger
instance
-
getLog
Provide anEnforcerLogger
instance for RuleNOTICE A logger is not available in constructors.
- Returns:
- an
EnforcerLogger
instance
-