gnodet commented on issue #497:
URL: 
https://github.com/apache/maven-resources-plugin/issues/497#issuecomment-5804448043

   Investigation summary:
   
   The root cause is in `EnhancedCompositeBeanHelper.buildFieldCache()` in 
Maven core: it used `put()` instead of `putIfAbsent()`. Since `DeclaredMembers` 
iterates child-first then parent, parent fields ended up overwriting child 
fields with the same name. Both `ResourcesMojo` and `TestResourcesMojo` declare 
a `private boolean skip` field, so the configurator always wrote 
`ResourcesMojo.skip` — leaving `TestResourcesMojo.skip` at `false` regardless 
of what was configured, so the `if (skip)` guard in 
`TestResourcesMojo.execute()` never fired.
   
   This has been fixed in Maven core by 
[apache/maven#12626](https://github.com/apache/maven/pull/12626) 
(`putIfAbsent()` matches what the method cache already did). The fix will land 
in **4.0.0-rc-7** (currently under vote).
   
   In the meantime, 
[#500](https://github.com/apache/maven-resources-plugin/pull/500) added a 
workaround in `TestResourcesMojo`: reading both fields with `if (skip || 
isSkip())`, with a TODO to remove the `isSkip()` half once the core fix is 
released. That should be cleaned up once rc-7 is released.


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