maven-shade-plugin icon indicating copy to clipboard operation
maven-shade-plugin copied to clipboard

[MSHADE-148] Don't attach exclusions that are already present

Open philipl opened this issue 6 years ago • 5 comments
trafficstars

Although I don't fully understand the scenarios where we re-evaluate the exclusions of a dependency, I do know that if we do, we will add them again, leading to a false indication that the dependency list has changed, leading to a regeneration and re-evaluation of the list, which then continues indefinitely, as the the same exclusions are added again and again.

To address the leaf problem, let's ensure that we never add an exclusion that is already present. That way, even if reevaluation occurs, it will not result in changes.

philipl avatar Mar 05 '19 05:03 philipl

addExclusion is generated code in core maven. That’s also why Exclusions don’t have an equals() implementation. I’d add a test case if I could come up with a repro case that triggered on its own. I added some discussion in the JIRA.

philipl avatar Mar 05 '19 06:03 philipl

Note, that the fix in #15 looks like the fix for why exclusions get reevaluated. Even if that is merged, this fix should be taken too for correctness.

philipl avatar Mar 05 '19 19:03 philipl

I also have this issue when building Apache Camel with a parallel build, similar to the above example. Given this looks like a threading issue, it's not always reproducible, so it's quite hard to think about a test which could reliably exercise the problem.

gnodet avatar Feb 02 '21 17:02 gnodet