in enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/utils/ArtifactMatcher.java [101:143]
private boolean match(
String groupId, String artifactId, String version, String type, String scope, String classifier)
throws InvalidVersionSpecificationException {
switch (parts.length) {
case 6:
if (!matches(parts[5], classifier)) {
return false;
}
case 5:
if (scope == null || scope.equals("")) {
scope = Artifact.SCOPE_COMPILE;
}
if (!matches(parts[4], scope)) {
return false;
}
case 4:
if (type == null || type.equals("")) {
type = "jar";
}
if (!matches(parts[3], type)) {
return false;
}
case 3:
if (!matches(parts[2], version)) {
if (!containsVersion(
VersionRange.createFromVersionSpec(parts[2]), new DefaultArtifactVersion(version))) {
return false;
}
}
case 2:
if (!matches(parts[1], artifactId)) {
return false;
}
case 1:
return matches(parts[0], groupId);
default:
throw new AssertionError();
}
}