Skip to content

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

Merged
slawekjaranowski merged 2 commits into
apache:maven-3.10.xfrom
slawekjaranowski:cp-12577-3.x
Aug 1, 2026
Merged

Add validation for Plexus-based plugin dependency injection#12651
slawekjaranowski merged 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

@slawekjaranowski
slawekjaranowski merged commit c7c70df into apache:maven-3.10.x Aug 1, 2026
18 checks passed
@slawekjaranowski
slawekjaranowski deleted the cp-12577-3.x branch August 1, 2026 15:43
@github-actions github-actions Bot added this to the 3.10.0 milestone Aug 1, 2026
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