public class DependencyConvergence extends java.lang.Object implements EnforcerRule
| Modifier and Type | Field and Description |
|---|---|
private static org.codehaus.plexus.i18n.I18N |
i18n |
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 your rule is cacheable, you must return a unique id when parameters or conditions change that would cause the
result to be different.
|
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 tells the system if the results are cacheable at all.
|
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 static org.codehaus.plexus.i18n.I18N i18n
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()
getCacheId in interface EnforcerRulepublic boolean isCacheable()
isCacheable in interface EnforcerRuletrue if rule is cacheablepublic boolean isResultValid(EnforcerRule rule)
isResultValid in interface EnforcerRulerule - true if the stored results are valid for the same id.