Add validation for Plexus-based plugin dependency injection - #12651
Open
slawekjaranowski wants to merge 2 commits into
Open
Add validation for Plexus-based plugin dependency injection#12651slawekjaranowski wants to merge 2 commits into
slawekjaranowski wants to merge 2 commits into
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. based on: 2a8b6b2
gnodet
approved these changes
Jul 31, 2026
gnodet
left a comment
Contributor
There was a problem hiding this comment.
Clean cherry-pick of the already-merged #12577 to the maven-3.10.x maintenance branch. The validator logic is identical to master; the test was properly adapted for the 3.10.x MojoDescriptor API (real instance via ComponentDescriptor.addRequirement rather than mocking). Adding mockito-junit-jupiter as a separate dependency is correct for 3.10.x, which doesn't use mockito-bom like master.
Two minor non-blocking nits (same as noted on #12649):
pluginValidationManagerfield isprotectedbut this is a concrete, package-private, final class with no subclasses — should beprivate- Missing
@since 3.10.0Javadoc tag (other validators in the same package include@since)
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
based on: 2a8b6b2