Class RequireUpperBoundDeps
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.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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionScope to exclude.Dependencies to ignore.Dependencies to include.private final ResolverUtil
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
buildErrorMessage
(List<org.eclipse.aether.graph.DependencyNode> conflict) buildErrorMessages
(List<List<org.eclipse.aether.graph.DependencyNode>> conflicts) private StringBuilder
buildTreeString
(org.eclipse.aether.graph.DependencyNode node) void
execute()
This is the interface into the rule.private String
getFullArtifactName
(org.eclipse.aether.graph.DependencyNode node, boolean usePremanaged) void
setExcludes
(List<String> excludes) Sets dependencies to exclude.void
setIncludes
(List<String> includes) Sets dependencies to include.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
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
getLog, setLog
-
Field Details
-
uniqueVersions
private boolean uniqueVersions- Since:
- 1.3
-
excludes
Dependencies to ignore.- Since:
- TBD
-
includes
Dependencies to include.- Since:
- 3.0.0
-
excludedScopes
Scope to exclude. -
upperBoundDepsVisitor
-
resolverUtil
-
-
Constructor Details
-
RequireUpperBoundDeps
-
-
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
-
buildErrorMessages
-
buildErrorMessage
-
buildTreeString
-
getFullArtifactName
private String getFullArtifactName(org.eclipse.aether.graph.DependencyNode node, boolean usePremanaged)
-