Add validation for Plexus-based plugin dependency injection - #12577
Conversation
What changed - Added a new validation that detects outdated dependency injection usage in plugins. - Added a clear warning for plugin developers when this pattern is found. - Pointed users to the recommended modern injection approach.
|
as continuation for: |
gnodet
left a comment
There was a problem hiding this comment.
Two minor issues confirmed in the warning message string — the validation logic and test coverage look solid.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
gnodet
left a comment
There was a problem hiding this comment.
Both issues from the prior review have been cleanly addressed in the "Apply review comments" commit:
{@code @Component}Javadoc syntax removed from runtime string — now uses(@Component annotation)- Grammar/phrasing improved — now reads naturally
- Unused
mockimport in the test was also removed
The validation logic is correct, tests cover both positive and negative paths, and CI is green.
Very minor (non-blocking): the constructor does not use requireNonNull(pluginValidationManager) unlike the abstract base classes in this package (AbstractMavenPluginParametersValidator, AbstractMavenPluginDependenciesValidator). With JSR 330 injection this is a non-issue in practice.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
gnodet
left a comment
There was a problem hiding this comment.
The latest commit adds requireNonNull(pluginValidationManager) in the constructor, cleanly addressing the minor observation from our previous review. The import style (import static java.util.Objects.requireNonNull) and usage pattern exactly match AbstractMavenPluginParametersValidator and AbstractMavenPluginDependenciesValidator in the same package. Consistent and correct.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
What changed