Repository navigation
Build a CompilerManager through ServiceLoader - #524
Closed
slachiewicz wants to merge 1 commit into
Closed
slachiewicz wants to merge 1 commit into
slachiewicz wants to merge 1 commit into
Conversation
Each compiler is listed both in the Sisu index and in META-INF/services; ServiceLoaderCompilersTest fails when the two lists differ. AbstractCompiler creates its Plexus logger wrapper lazily so compilers load without the Plexus logging API; do not move it back into the constructor.
This was referenced Oct 5, 2026
Closed
Member
Author
|
Not needed: Maven 4 API mojos will inject Sisu components from their plugin realm through |
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.
DefaultCompilerManager.fromServiceLoader(ClassLoader)builds a compiler manager fromMETA-INF/servicesinstead of a Sisu container, so a plugin written to the Maven 4 API, which cannot inject Sisu components from its own jars, can create one and bind it with a@Providesmethod. The Sisu wiring is unchanged.Compilers are keyed by their
@Namedvalue, as Sisu does.@Singletoncompilers (javac, eclipse) are shared; aspectj, csharp and javac-errorprone get a new instance pergetCompilercall, as with Sisu. A provider that cannot be loaded is skipped with a warning. Two small changes make the compilers load without a container:JavacCompilercreates itsJavaxToolsCompilerwhen nothing injects one, andAbstractCompilercreates its deprecated Plexus logger wrapper on first use, because the Plexus logging API is only provided by Maven at run time.The new
plexus-compiler-service-loader-testmodule checks that each compiler module's services file lists the same classes as its generated Sisu index.Same approach as apache/maven-scm#1418; context in apache/maven#13302.
Verified:
mvn verify→ full reactor green, 12 ITs; 5 new tests.