slachiewicz opened a new issue, #13810:
URL: https://github.com/apache/maven/issues/13810

   ### Affected version
   
   master (d9746769), 4.0.0-rc-7
   
   ### Bug description
   
   When `@InjectMojo(goal = ..., pom = ...)` is put on a test method parameter, 
`MojoExtension.resolveParameter` merges that POM into the model it uses for the 
mojo configuration 
([`MojoExtension.java:244`](https://github.com/apache/maven/blob/master/impl/maven-testing/src/main/java/org/apache/maven/testing/plugin/MojoExtension.java#L244)).
 The `Project` singleton is created in `beforeEach` 
([`MojoExtension.java:485`](https://github.com/apache/maven/blob/master/impl/maven-testing/src/main/java/org/apache/maven/testing/plugin/MojoExtension.java#L485))
 from the method-level annotation only, so the injected mojo is configured from 
one POM while `Project` (and `${project.*}` expressions) come from another.
   
   Reproduction: a test with a method-level `@InjectMojo(goal = "...")` and a 
parameter-level `@InjectMojo(goal = "...", pom = "...")` whose POM sets 
`groupId` to `customGroupId` and a plugin parameter. The mojo gets the 
parameter value from that POM, but the injected `Project` reports `expected: 
<customGroupId> but was: <myGroupId>`.
   


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