Class ArtifactUtils
- java.lang.Object
-
- org.apache.maven.plugins.enforcer.utils.ArtifactUtils
-
public final class ArtifactUtils extends java.lang.Object
- Since:
- 3.0.0
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ArtifactUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.private static boolean
compareDependency(java.lang.String pattern, org.apache.maven.artifact.Artifact artifact)
Compares the given pattern against the given artifact.static java.util.Set<org.apache.maven.artifact.Artifact>
getAllDescendants(org.apache.maven.shared.dependency.graph.DependencyNode node)
-
-
-
Method Detail
-
getAllDescendants
public static java.util.Set<org.apache.maven.artifact.Artifact> getAllDescendants(org.apache.maven.shared.dependency.graph.DependencyNode node)
-
checkDependencies
public static 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
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(java.lang.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:
true
if the artifact matches one of the patterns- Throws:
EnforcerRuleException
- the enforcer rule exception
-
-