sparsick commented on PR #268:
URL: 
https://github.com/apache/maven-source-plugin/pull/268#issuecomment-3718375787

   The root cause of the problem:
   
   `EnhancedCompositeBeanHelper` in maven-core is responsible for setting the 
right values for the mojo properties. In this case, both mojos (`SourceJarMojo` 
and `TestSourceJarMojo`) have the same properties. The helper is reusing an 
internal cache (`ACCESSIBLE_FIELD_CACHE`) for both mojos, and therefore for the 
run of the second mojo, the information of the cache is invalid because the 
field of the second mojo has to be set to accessible, but this step is skipped 
because the cache is filled.
   
   In the unit tests, a workaround is to add 
`EnhancedCompositeBeanHelper.clearCaches();` as a cleanup step. In the invoker 
tests it is not possible.
   
   @gnodet: Is this behavior a bug? Or do you have a hint how to avoid it?
   
   


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