gnodet commented on PR #13658:
URL: https://github.com/apache/maven/pull/13658#issuecomment-6301137361
Thanks for the thorough review! All three issues have been addressed in the
updated push (83fdd26786):
**1. Factories invisible to `DiIndexProcessor` when generated in
`processingOver()`** ✅
Refactored `generateFactories()` into `generateFactory(TypeElement)`
(singular), called immediately when a mojo is first seen in a normal processing
round. Factories are now emitted in round N, so `DiIndexProcessor` sees
`@Named` in round N+1. The `processingOver()` block now only writes
`plugin.xml`.
**2. `@SupportedSourceVersion(RELEASE_17)` warning on JDK 21+** ✅
Removed the `@SupportedSourceVersion` annotation and the
`SupportedSourceVersion` import. Added `@Override public SourceVersion
getSupportedSourceVersion() { return SourceVersion.latestSupported(); }`
instead.
**3. `validateOptions()` double error printing** ✅
Changed `validateOptions()` to return `boolean` instead of throwing
`IllegalStateException`. The `processingOver()` block returns early on `false`.
The broad `catch (Exception e)` now only wraps the `writePluginXml()` call,
which cannot be reached with invalid options.
**Bonus: `deriveGoalPrefix` suffix order bug** (caught by the unit tests
added in this push)
The `-plugin` suffix was checked before `-maven-plugin`, so
`"example-maven-plugin"` was incorrectly yielding `"example-maven"`. Fixed by
checking the longer suffix first.
**Also added in this push:**
- 13 unit tests (`MojoDescriptorProcessorTest`) using
`javax.tools.JavaCompiler` in-process — all green
- IT `gh-13644-plugin-processor` testing end-to-end plugin build + execution
with the processor
- Updated `mng-12534` IT plugin to use the processor instead of
`maven-plugin-plugin`
- Site documentation (`index.md`, `usage.md`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]