Class RequireUpperBoundDeps
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
org.apache.maven.enforcer.rules.dependency.RequireUpperBoundDeps
- All Implemented Interfaces:
EnforcerRuleBase
@Named("requireUpperBoundDeps")
public final class RequireUpperBoundDeps
extends AbstractStandardEnforcerRule
Rule to enforce that the resolved dependency is also the most recent one of all transitive dependencies.
- Since:
- 1.1
- Author:
- Geoffrey De Smet
-
Constructor Summary
ConstructorDescriptionRequireUpperBoundDeps
(org.apache.maven.enforcer.rules.dependency.ResolverUtil resolverUtil) -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
This is the interface into the rule.getLog()
Provide anEnforcerLogger
instance for Rulevoid
setExcludes
(List<String> excludes) Sets dependencies to exclude.void
setIncludes
(List<String> includes) Sets dependencies to include.void
setLog
(EnforcerLogger log) Used byEnforcerMojo
to inject logger instanceMethods 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
-
RequireUpperBoundDeps
@Inject public RequireUpperBoundDeps(org.apache.maven.enforcer.rules.dependency.ResolverUtil resolverUtil)
-
-
Method Details
-
setExcludes
Sets dependencies to exclude.- Parameters:
excludes
- a list ofgroupId:artifactId
names
-
setIncludes
Sets dependencies to include.- Parameters:
includes
- a list ofgroupId:artifactId
names
-
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
-
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
-