gnodet commented on code in PR #12548:
URL: https://github.com/apache/maven/pull/12548#discussion_r3660076406
##########
api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java:
##########
@@ -445,6 +445,17 @@ public final class Constants {
@Config(defaultValue = "default")
public static final String MAVEN_RESOLVER_TRANSPORT =
"maven.resolver.transport";
+ /**
+ * Resolver validation control.
+ * Can be <code>default</code> (full validation), <code>mild</code> (only
uninterpolated placeholders) or
Review Comment:
The Javadoc documents lowercase values (`default`, `mild`, `off`) and
`@Config(defaultValue = "default")` uses lowercase too. However,
`ConfigUtils.getEnum` in resolver 2.0.21 calls `Enum.valueOf(enumClass,
(String) value)` which is case-sensitive. A user setting
`-Dmaven.resolver.validation=default` (following this doc) will hit
`IllegalArgumentException` because the enum constant is `DEFAULT`.
Consider either:
1. Updating the Javadoc/defaultValue to use uppercase (`DEFAULT`, `MILD`,
`OFF`), or
2. Adding a `toUpperCase(Locale.ROOT)` call before the enum lookup in
`MavenValidatorFactory`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]