gnodet opened a new pull request, #13914:
URL: https://github.com/apache/maven/pull/13914

   ## Summary
   
   Add `MavenITgh13911ReactorAnnotationProcessorTest` to verify that an 
annotation processor (AP) built from source in the same Maven reactor can be 
used by a sibling module's `compile` phase — with both the sequential and 
concurrent builders.
   
   ## Background
   
   Andres Almiray 
[reported](https://bsky.app/profile/andresalmiray.com/post/3mznzo2zaas2i) that 
he couldn't get this working with Maven 3.8.x, prompting the question (via PR 
#13559) of whether the same reactor-ordering problem affects annotation 
processors.
   
   The answer is: **not in the same way**. Reactor plugins are auto-detected by 
Maven without a POM dependency; that's the class of problem #13559 fixes. 
Annotation processors require an explicit `<dependency>` (scope `provided`), 
which gives Maven the DAG edge it needs to build the AP module first — no 
special reactor detection is involved. However, there was no IT to prove this 
actually works, so here it is.
   
   ## Test design
   
   The test fixture is a two-module reactor:
   
   - `processor/` — a `jar` module declaring a 
`javax.annotation.processing.Processor` via `META-INF/services`. It writes 
`META-INF/generated-by-gh13911.txt` to the class output directory for any type 
annotated `@Gh13911Generated`.
   - `client/` — a `jar` module that declares `processor` as a `provided` 
dependency (for ordering) and configures it via `<annotationProcessorPaths>` in 
`maven-compiler-plugin` (required for service-loader discovery from a classes 
directory, since at `compile` phase the processor is not yet packaged into a 
jar).
   
   Two test methods:
   1. `testReactorAnnotationProcessorSequential` — standard (sequential) builder
   2. `testReactorAnnotationProcessorConcurrent` — `-b concurrent`
   
   Both pass locally against 4.2.0-SNAPSHOT.
   
   A companion PR against `apache/maven-integration-testing` covers Maven 
3.10.x.
   
   ## Test plan
   
   - [x] `MavenITgh13911ReactorAnnotationProcessorTest` passes (sequential + 
concurrent) — verified locally
   - [ ] CI green
   
   Fixes #13911
   
   _Hermès Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
   


-- 
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]

Reply via email to