public class DependencyConvergence extends java.lang.Object implements EnforcerRule
| Modifier and Type | Field and Description |
|---|---|
private static org.apache.maven.plugin.logging.Log |
log |
private boolean |
uniqueVersions |
| Constructor and Description |
|---|
DependencyConvergence() |
| Modifier and Type | Method and Description |
|---|---|
private java.lang.String |
buildConvergenceErrorMsg(java.util.List<org.apache.maven.shared.dependency.graph.DependencyNode> nodeList) |
private java.lang.StringBuilder |
buildTreeString(org.apache.maven.shared.dependency.graph.DependencyNode node) |
void |
execute(EnforcerRuleHelper helper)
This is the interface into the rule.
|
java.lang.String |
getCacheId()
If the rule is to be cached, this id is used as part of the key.
|
private java.util.List<java.lang.String> |
getConvergenceErrorMsgs(java.util.List<java.util.List<org.apache.maven.shared.dependency.graph.DependencyNode>> errors) |
private java.lang.String |
getFullArtifactName(org.apache.maven.artifact.Artifact artifact) |
private org.apache.maven.shared.dependency.graph.DependencyNode |
getNode(EnforcerRuleHelper helper)
Uses the
EnforcerRuleHelper to populate the values of the
DependencyTreeBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)
factory method. |
boolean |
isCacheable()
This method tells the enforcer if the rule results may be cached.
|
boolean |
isResultValid(EnforcerRule rule)
If the rule is cacheable and the same id is found in the cache, the stored results are passed to this method to
allow double checking of the results.
|
void |
setUniqueVersions(boolean uniqueVersions) |
private static org.apache.maven.plugin.logging.Log log
private boolean uniqueVersions
public void setUniqueVersions(boolean uniqueVersions)
private org.apache.maven.shared.dependency.graph.DependencyNode getNode(EnforcerRuleHelper helper) throws EnforcerRuleException
EnforcerRuleHelper to populate the values of the
DependencyTreeBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)
factory method. EnforcerRuleHelper has to do.helper - EnforcerRuleExceptionpublic void execute(EnforcerRuleHelper helper) throws EnforcerRuleException
EnforcerRuleexecute in interface EnforcerRulehelper - The helper provides access to the log, MavenSession and has
helpers to get common components. It is also able to lookup components
by class name.EnforcerRuleException - the enforcer rule exceptionprivate java.lang.String getFullArtifactName(org.apache.maven.artifact.Artifact artifact)
private java.lang.StringBuilder buildTreeString(org.apache.maven.shared.dependency.graph.DependencyNode node)
private java.util.List<java.lang.String> getConvergenceErrorMsgs(java.util.List<java.util.List<org.apache.maven.shared.dependency.graph.DependencyNode>> errors)
private java.lang.String buildConvergenceErrorMsg(java.util.List<org.apache.maven.shared.dependency.graph.DependencyNode> nodeList)
public java.lang.String getCacheId()
EnforcerRulegetCacheId in interface EnforcerRulepublic boolean isCacheable()
EnforcerRuleisCacheable in interface EnforcerRuletrue if rule is cacheablepublic boolean isResultValid(EnforcerRule rule)
EnforcerRuleisResultValid in interface EnforcerRulerule - the last cached instance of the rule. This is to be used by the rule to
potentially determine if the results are still valid (ie if the configuration has been overridden)true if the stored results are valid for the same id.