Class ArtifactUtils

java.lang.Object
org.apache.maven.plugins.enforcer.utils.ArtifactUtils

public final class ArtifactUtils extends Object
Since:
3.0.0
  • Constructor Details

    • ArtifactUtils

      private ArtifactUtils()
  • Method Details

    • getAllDescendants

      public static Set<org.apache.maven.artifact.Artifact> getAllDescendants(org.apache.maven.shared.dependency.graph.DependencyNode node)
    • 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 patterns
      dependencies - 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 format groupId: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