Skip to content

Conversation

@snazy
Copy link
Contributor

@snazy snazy commented Nov 14, 2025

The current patterns (META-INF/LICENSE + META-INF/NOTICE et al) work for many dependencies, but sadly not all.
Some dependencies put those files in the jar's "root directory".

This change allows configuring the set of matched paths, and also allows overriding the output path (just in case).

Closes #1844.


  • CHANGELOG's "Unreleased" section has been updated, if applicable.

The `ApacheLicenseResourceTransformer` effectively removes all `META-INF/LICENSE*` files from the resulting jar.

This change _changes_ the behavior of `ApacheLicenseResourceTransformer` to concatenate the included license files. Identical license texts are included once.

Adapted the `ApacheLicenseResourceTransformerTest` for this change.

Fixes GradleUp#1842
…transformers

The current patterns (`META-INF/LICENSE` + `META-INF/NOTICE` et al) work for many dependencies, but sadly not all.
Some dependencies put those files in the jar's "root directory".

This change allows configuring the set of matched paths, and also allows overriding the output path (just in case).
@snazy
Copy link
Contributor Author

snazy commented Nov 14, 2025

(Depends on #1842 / merge-conflicts)

@snazy snazy closed this Nov 15, 2025
@snazy snazy deleted the apache-patterns-configurable branch November 15, 2025 10:29
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled by #1850.

Comment on lines +54 to +60
/**
* Path of the resulting output file.
*
* Defaults to `META-INF/NOTICE`.
*/
@get:Input
public open val outputPath: Property<String> = objectFactory.property("META-INF/NOTICE")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configurable source path patterns for Apache license/notice resource transformers

2 participants