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
ConstructorsConstructorDescriptionRequireUpperBoundDeps(org.apache.maven.enforcer.rules.dependency.ResolverUtil resolverUtil) -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()This is the interface into the rule.getLog()Provide anEnforcerLoggerinstance for RulevoidsetExcludes(List<String> excludes) Sets dependencies to exclude.voidsetIncludes(List<String> includes) Sets dependencies to include.voidsetLog(EnforcerLogger log) Used byEnforcerMojoto inject logger instanceMethods inherited from class org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
formatLocation, getMessage, setMessageMethods 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:artifactIdnames
-
setIncludes
Sets dependencies to include.- Parameters:
includes- a list ofgroupId:artifactIdnames
-
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.- Specified by:
executein classAbstractEnforcerRule- Throws:
EnforcerRuleException- the enforcer rule exception
-
setLog
Used byEnforcerMojoto inject logger instance- Specified by:
setLogin interfaceEnforcerRuleBase- Parameters:
log- anEnforcerLoggerinstance
-
getLog
Provide anEnforcerLoggerinstance for RuleNOTICE A logger is not available in constructors.
- Returns:
- an
EnforcerLoggerinstance
-