public class BannedDependencies extends AbstractBanDependencies
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
excludes
Specify the banned dependencies.
|
private java.util.List<java.lang.String> |
includes
Specify the allowed dependencies.
|
Constructor and Description |
---|
BannedDependencies() |
Modifier and Type | Method and Description |
---|---|
private java.util.Set<org.apache.maven.artifact.Artifact> |
checkDependencies(java.util.Set<org.apache.maven.artifact.Artifact> dependencies,
java.util.List<java.lang.String> thePatterns)
Checks the set of dependencies against the list of patterns.
|
protected java.util.Set<org.apache.maven.artifact.Artifact> |
checkDependencies(java.util.Set<org.apache.maven.artifact.Artifact> theDependencies,
org.apache.maven.plugin.logging.Log log)
Checks the set of dependencies against the list of excludes.
|
protected boolean |
compareDependency(java.lang.String pattern,
org.apache.maven.artifact.Artifact artifact)
Compares the given pattern against the given artifact.
|
java.util.List<java.lang.String> |
getExcludes()
Gets the excludes.
|
java.util.List<java.lang.String> |
getIncludes()
Gets the includes.
|
void |
setExcludes(java.util.List<java.lang.String> theExcludes)
Specify the banned dependencies.
|
void |
setIncludes(java.util.List<java.lang.String> theIncludes)
Specify the allowed dependencies.
|
execute, getDependenciesToCheck, getErrorMessage, isSearchTransitive, setSearchTransitive
getCacheId, isCacheable, isResultValid
getLevel, getMessage, setLevel, setMessage
private java.util.List<java.lang.String> excludes
groupId[:artifactId][:version]
. Any of the sections can be a wildcard
by using '*' (ie group:*:1.0) #setExcludes(List)}
,
#getExcludes()}
private java.util.List<java.lang.String> includes
groupId[:artifactId][:version]
. Any of the sections can be a wildcard
by using '*' (ie group:*:1.0) #setIncludes(List)}
,
#getIncludes()}
protected java.util.Set<org.apache.maven.artifact.Artifact> checkDependencies(java.util.Set<org.apache.maven.artifact.Artifact> theDependencies, org.apache.maven.plugin.logging.Log log) throws EnforcerRuleException
checkDependencies
in class AbstractBanDependencies
theDependencies
- the dependencieslog
- the logEnforcerRuleException
- the enforcer rule exceptionprivate java.util.Set<org.apache.maven.artifact.Artifact> checkDependencies(java.util.Set<org.apache.maven.artifact.Artifact> dependencies, java.util.List<java.lang.String> thePatterns) throws EnforcerRuleException
thePatterns
- the patternsdependencies
- the dependenciesnull
EnforcerRuleException
- the enforcer rule exceptionprotected boolean compareDependency(java.lang.String pattern, org.apache.maven.artifact.Artifact artifact) throws EnforcerRuleException
groupId:artifactId:version:type:scope:classifier
.pattern
- The pattern to compare the artifact with.artifact
- the artifacttrue
if the artifact matches one of the patternsEnforcerRuleException
- the enforcer rule exceptionpublic java.util.List<java.lang.String> getExcludes()
public void setExcludes(java.util.List<java.lang.String> theExcludes)
groupId[:artifactId][:version]
. Any of the sections can be a wildcard
by using '*' (ie group:*:1.0) theExcludes
- the excludes to setgetExcludes()
public java.util.List<java.lang.String> getIncludes()
public void setIncludes(java.util.List<java.lang.String> theIncludes)
groupId[:artifactId][:version]
. Any of the sections can be a wildcard
by using '*' (ie group:*:1.0) theIncludes
- the includes to setsetIncludes(List)