The build creates a handful of jars from other jars. This results in duplicate LICENSE.txt and NOTICE.txt files as they come both from the original jar and our conventions that add them to each jar that's built.
Comment From: wilkinsona
The first attempt at this caused #24131 so it needs to be reverted for now.
Comment From: dreis2211
May I give this an attempt, @wilkinsona ?
Comment From: wilkinsona
@dreis2211 That'd be great, thank you. As you can see above I had one attempt that fixed the duplicates but introduced another problem so perhaps use https://github.com/spring-projects/spring-boot/commit/1e100677c722db4f9839d39d4b104307d4917cc9 as an example of what not to do! I haven't had a chance to take another look.
Comment From: wilkinsona
When merged, https://github.com/spring-projects/spring-boot/pull/25116 will fix this problem by adding some excludes in a handful of projects that create a jar from an existing jar. It'd be nice to fix the conventions so that they don't create the problem in the first place.
Comment From: philwebb
I wonder if we should close this one. I think in general we still want our conventions to apply to all jar tasks to make sure we have the manifest customization. We could try and be smart about applying extractLegalResources, but there's no guarantee that the jar we're including actually has a NOTICE.txt and LICENSE.txt. I think the fix in #25116 might be enough.
Comment From: wilkinsona
Sounds good to me. We can always re-open this if we change our minds for some reason.