Skip to content

Add validation for Plexus-based plugin dependency injection - #12651

Open
slawekjaranowski wants to merge 2 commits into
apache:maven-3.10.xfrom
slawekjaranowski:cp-12577-3.x
Open

Add validation for Plexus-based plugin dependency injection#12651
slawekjaranowski wants to merge 2 commits into
apache:maven-3.10.xfrom
slawekjaranowski:cp-12577-3.x

Conversation

@slawekjaranowski

Copy link
Copy Markdown
Member

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

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
@slawekjaranowski slawekjaranowski self-assigned this Jul 31, 2026
@slawekjaranowski slawekjaranowski added mvn3 enhancement New feature or request labels Jul 31, 2026

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

  • pluginValidationManager field is protected but this is a concrete, package-private, final class with no subclasses — should be private
  • Missing @since 3.10.0 Javadoc 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request mvn3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants