cstamas commented on code in PR #2008:
URL: https://github.com/apache/maven-resolver/pull/2008#discussion_r3644173117
##########
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/validator/Validator.java:
##########
@@ -54,6 +54,20 @@ default void validateMetadata(Metadata metadata) throws
IllegalArgumentException
*/
default void validateDependency(Dependency dependency) throws
IllegalArgumentException {}
+ /**
+ * Validates managed dependency.
+ * <em>Important:</em> They are declarative constraints
(version/scope/exclusion overrides) that only take effect
+ * when a matching dependency is encountered during collection. Validating
them eagerly may reject valid builds
+ * where a BOM imports managed dependencies with uninterpolated property
expressions (e.g. {@code ${osgi.version}})
+ * that are never actually used. If a managed dependency IS matched and
its coordinates are invalid, the error
+ * will surface naturally during version resolution or artifact resolution.
+ *
+ * @param managedDependency The managed dependency to validate, never
{@code null}.
Review Comment:
While I agree with this sentiment, this javadoc method is not the single one
in this PR not following that, and in this codebase this is not the single one
either (in fact, whole codebase follows this style). I'd leave this change to
some time, and IMO the change should be done consistently across whole codebase.
--
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]