Replace Plexus XML configuration with JSR-330 annotated beans - #160
Merged
Conversation
## What changed
- Added `@Named("ToolchainsRequirement")` and `@Singleton` annotations to `ToolchainConverter`
- Created `ToolchainsComponentConfigurator` extending `BasicComponentConfigurator` — injects `ToolchainConverter` and registers it on initialization
- Removed `src/main/resources/META-INF/plexus/components.xml`
## Why
- JSR-330 annotations with Sisu replace legacy Plexus XML component descriptors
- `sisu-maven-plugin` auto-generates component indexes from annotations, eliminating manual XML maintenance
- Cleaner, more maintainable approach with annotations co-located with code
## Testing
- All unit tests pass
- Sisu index correctly includes both annotated beans
- Plugin configuration remains unchanged — `@Mojo(configurator = "toolchains-requirement-configurator")` works as before
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the plugin’s custom Plexus component wiring from a components.xml descriptor to Sisu/JSR-330 annotated components, aiming to keep the @Mojo(configurator = "toolchains-requirement-configurator") behavior working without manual XML maintenance.
Changes:
- Removed
META-INF/plexus/components.xmlcomponent descriptor. - Added JSR-330 annotations for the
ToolchainConverterand introduced aToolchainsComponentConfiguratorto register the converter. - Added a
toString()implementation toToolchainsRequirement.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/main/resources/META-INF/plexus/components.xml | Removes legacy Plexus component descriptor wiring. |
| src/main/java/org/apache/maven/plugins/toolchain/ToolchainsRequirement.java | Adds a toString() for easier logging/debugging. |
| src/main/java/org/apache/maven/plugins/toolchain/ToolchainsComponentConfigurator.java | Adds an annotated configurator intended to replace the XML-based configurator/lookup wiring. |
| src/main/java/org/apache/maven/plugins/toolchain/ToolchainConverter.java | Annotates the converter bean and adjusts conversion logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
slawekjaranowski
force-pushed
the
jsr-330
branch
from
July 13, 2026 20:52
77fadb8 to
98179e8
Compare
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
@Named("ToolchainsRequirement")and@Singletonannotations toToolchainConverterToolchainsComponentConfiguratorextendingBasicComponentConfigurator— injectsToolchainConverterand registers it on initializationsrc/main/resources/META-INF/plexus/components.xmlWhy
sisu-maven-pluginauto-generates component indexes from annotations, eliminating manual XML maintenanceTesting
@Mojo(configurator = "toolchains-requirement-configurator")works as beforeFollowing this checklist to help us incorporate your
contribution quickly and easily:
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
mvn verifyto make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
mvn -Prun-its verify).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.