Class ArtifactMatcher
java.lang.Object
org.apache.maven.plugins.enforcer.utils.ArtifactMatcher
This class is used for matching Artifacts against a list of patterns.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Collection<ArtifactMatcher.Pattern>private Collection<ArtifactMatcher.Pattern> -
Constructor Summary
ConstructorsConstructorDescriptionArtifactMatcher(Collection<String> patterns, Collection<String> ignorePatterns) Construct class by providing patterns as strings. -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatch(org.apache.maven.artifact.Artifact artifact) Check if artifact matches patterns.
-
Field Details
-
patterns
-
ignorePatterns
-
-
Constructor Details
-
ArtifactMatcher
Construct class by providing patterns as strings. Empty strings are ignored.- Parameters:
patterns- includesignorePatterns- excludes- Throws:
NullPointerException- if any of the arguments is null
-
-
Method Details
-
match
public boolean match(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.artifact.versioning.InvalidVersionSpecificationException Check if artifact matches patterns.- Parameters:
artifact- the artifact to match- Returns:
trueif artifact matches anypatternsand none of theignorePatterns, otherwisefalse- Throws:
org.apache.maven.artifact.versioning.InvalidVersionSpecificationException- if any pattern contains an invalid version range
-