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 privateArtifactUtils()
-
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 booleancompareDependency(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 EnforcerRuleExceptionChecks 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 EnforcerRuleExceptionCompares 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
-
-