Hi Estelle.

Thanks for the reproducer, great job!

When the mojo is running concurrently, each thread gets its own mojo
instance. I.e., there can only be a problem if

  a) the mojo uses static variables in a thread-unsafe way or

  b) the mojo uses some shared state from Maven itself.

Case (a) seems not to be the case, I briefly looked throught the source
code. There are only static inner classes, static methods and final
static fields, nothing fishy.

As for case (b), when calculating the dependency-reduced POM (DRP), the
plugin uses (a clone of) the Maven project model. There was a fix for
the endless loop problem in 3.4.1, see
https://issues.apache.org/jira/browse/MSHADE-413. My unverified
hypothesis for now is that the fix was imperfect and there is still some
shared state with Maven that the plugin is messing with unwillingly.
Maybe some cloned state is not cloned deeply enough or something that
ought have been clones was just referenced.

To answer your question: Yes, I think it makes sense to create a MSHADE
issue, pointing to this conversation, MSHADE-413 and your reproducer.
Maybe today I have a little bit of time to look into it. If I am lucky
enough to identify and solve the problem, I can create an issue myself,
if none exists yet until then.

Kind regards
-- 
Alexander Kriegisch
https://scrum-master.de


Estelle Bremont schrieb am 20.01.2024 00:37 (GMT +07:00):

> Hello !
> I work with François. Here's a quite simple example reproducing the problem
> : https://github.com/stl543/shadeMT
> It has a parent pom so the 4 child modules have strictly the same
> configuration apart from their artifactId.
> 
> The following command will give you results varying between 12, 16 and 20
> showing that <exclusions> are sometimes missing from the generated
> dependency-reduced-pom.xml. Usually all the poms are generated the same
> (which is expected) but sometimes some have exclusions that others do not.
> 
> mvn clean package -T 1C && find . -name "dependency-reduced-pom.xml" -exec
> bash -c 'cat $0 | grep exclu | wc -l ' {} \;
> 
> 
> 
> - shade 3.5.1 & 3.4.1 : have the problem of missing exclusions
> - shade ranging from 3.2.1 to 3.4.0 have freeze problems (known bug)
> - shade 3.2.0 : ok
> - shade 3.1.0 : ok
> 
> Do you think I should open an issue directly with the shade plugin ?
> Best regards,
> Estelle
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to