Class ArtifactUtils
java.lang.Object
org.apache.maven.plugins.enforcer.utils.ArtifactUtils
- Since:
- 3.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<org.apache.maven.artifact.Artifact>checkDependencies(Set<org.apache.maven.artifact.Artifact> dependencies, List<String> thePatterns) Checks the set of dependencies against the list of patterns.private static booleancompareDependency(String pattern, org.apache.maven.artifact.Artifact artifact) Compares the given pattern against the given artifact.static Set<org.apache.maven.artifact.Artifact>getAllDescendants(org.apache.maven.shared.dependency.graph.DependencyNode node)
-
Constructor Details
-
ArtifactUtils
private ArtifactUtils()
-
-
Method Details
-
checkDependencies
public static Set<org.apache.maven.artifact.Artifact> checkDependencies(Set<org.apache.maven.artifact.Artifact> dependencies, List<String> thePatterns) throws EnforcerRuleException Checks the set of dependencies against the list of patterns.- Parameters:
thePatterns- the patternsdependencies- the dependencies- Returns:
- a set containing artifacts matching one of the patterns or
null - Throws:
EnforcerRuleException- the enforcer rule exception
-
compareDependency
private static boolean compareDependency(String pattern, org.apache.maven.artifact.Artifact artifact) throws EnforcerRuleException Compares the given pattern against the given artifact. The pattern should follow the formatgroupId:artifactId:version:type:scope:classifier.- Parameters:
pattern- The pattern to compare the artifact with.artifact- the artifact- Returns:
trueif the artifact matches one of the patterns- Throws:
EnforcerRuleException- the enforcer rule exception