-
-
Notifications
You must be signed in to change notification settings - Fork 424
Add MergeLicenseResourceTransformer to merge licenses
#1858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+343
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37ff702 to
4b05489
Compare
snazy
added a commit
to snazy/shadow
that referenced
this pull request
Nov 17, 2025
Adds a new `DeduplicatingResourceTransformer` that works different than `PreserveFirstFoundResourceTransformer`. `PreserveFirstFoundResourceTransformer` is to preserve the first resource that matches the configured paths and ignore all other ones. `DeduplicatingResourceTransformer` preserves resources by path _and_ identical content and fails for all not explicitly allowed (excluded) resources with different content. It works intentionally against all resources. The new one is intended to guard a couple of unexpected situations: * A (transitive) dependency brings a non-relocated version of a dependency that is also included elsewhere but with a different version. This could normally lead to unexpected exceptions during runtime. * Unintended inclusion or removal or legally important license information, see also `MergeLicenseResourceTransformer` (GradleUp#1858). * Unintended removal or (false) inclusion of shaded dependency information via `META-INF/x/y/pom.xml`/`.properties` files, which can be important for dependency/license analyzation tools. Adding the functionality of `DeduplicatingResourceTransformer` to `PreserveFirstFoundResourceTransformer` became a bit too difficult without breaking the existing behavior of the latter.
1 task
snazy
added a commit
to snazy/shadow
that referenced
this pull request
Nov 17, 2025
Adds a new `DeduplicatingResourceTransformer` that works different than `PreserveFirstFoundResourceTransformer`. `PreserveFirstFoundResourceTransformer` is to preserve the first resource that matches the configured paths and ignore all other ones. `DeduplicatingResourceTransformer` preserves resources by path _and_ identical content and fails for all not explicitly allowed (excluded) resources with different content. It works intentionally against all resources. The new one is intended to guard a couple of unexpected situations: * A (transitive) dependency brings a non-relocated version of a dependency that is also included elsewhere but with a different version. This could normally lead to unexpected exceptions during runtime. * Unintended inclusion or removal or legally important license information, see also `MergeLicenseResourceTransformer` (GradleUp#1858). * Unintended removal or (false) inclusion of shaded dependency information via `META-INF/x/y/pom.xml`/`.properties` files, which can be important for dependency/license analyzation tools. Adding the functionality of `DeduplicatingResourceTransformer` to `PreserveFirstFoundResourceTransformer` became a bit too difficult without breaking the existing behavior of the latter.
Goooler
reviewed
Nov 18, 2025
...m/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformerTest.kt
Outdated
Show resolved
Hide resolved
...m/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformerTest.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
4b05489 to
2a1b98f
Compare
snazy
added a commit
to snazy/shadow
that referenced
this pull request
Nov 18, 2025
Adds a new `DeduplicatingResourceTransformer` that works different than `PreserveFirstFoundResourceTransformer`. `PreserveFirstFoundResourceTransformer` is to preserve the first resource that matches the configured paths and ignore all other ones. `DeduplicatingResourceTransformer` preserves resources by path _and_ identical content and fails for all not explicitly allowed (excluded) resources with different content. It works intentionally against all resources. The new one is intended to guard a couple of unexpected situations: * A (transitive) dependency brings a non-relocated version of a dependency that is also included elsewhere but with a different version. This could normally lead to unexpected exceptions during runtime. * Unintended inclusion or removal or legally important license information, see also `MergeLicenseResourceTransformer` (GradleUp#1858). * Unintended removal or (false) inclusion of shaded dependency information via `META-INF/x/y/pom.xml`/`.properties` files, which can be important for dependency/license analyzation tools. Adding the functionality of `DeduplicatingResourceTransformer` to `PreserveFirstFoundResourceTransformer` became a bit too difficult without breaking the existing behavior of the latter.
snazy
added a commit
to snazy/shadow
that referenced
this pull request
Nov 18, 2025
Adds a new `DeduplicatingResourceTransformer` that works different than `PreserveFirstFoundResourceTransformer`. `PreserveFirstFoundResourceTransformer` is to preserve the first resource that matches the configured paths and ignore all other ones. `DeduplicatingResourceTransformer` preserves resources by path _and_ identical content and fails for all not explicitly allowed (excluded) resources with different content. It works intentionally against all resources. The new one is intended to guard a couple of unexpected situations: * A (transitive) dependency brings a non-relocated version of a dependency that is also included elsewhere but with a different version. This could normally lead to unexpected exceptions during runtime. * Unintended inclusion or removal or legally important license information, see also `MergeLicenseResourceTransformer` (GradleUp#1858). * Unintended removal or (false) inclusion of shaded dependency information via `META-INF/x/y/pom.xml`/`.properties` files, which can be important for dependency/license analyzation tools. Adding the functionality of `DeduplicatingResourceTransformer` to `PreserveFirstFoundResourceTransformer` became a bit too difficult without breaking the existing behavior of the latter.
ce9d32c to
88316b4
Compare
snazy
added a commit
to snazy/shadow
that referenced
this pull request
Nov 18, 2025
Adds a new `DeduplicatingResourceTransformer` that works different than `PreserveFirstFoundResourceTransformer`. `PreserveFirstFoundResourceTransformer` is to preserve the first resource that matches the configured paths and ignore all other ones. `DeduplicatingResourceTransformer` preserves resources by path _and_ identical content and fails for all not explicitly allowed (excluded) resources with different content. It works intentionally against all resources. The new one is intended to guard a couple of unexpected situations: * A (transitive) dependency brings a non-relocated version of a dependency that is also included elsewhere but with a different version. This could normally lead to unexpected exceptions during runtime. * Unintended inclusion or removal or legally important license information, see also `MergeLicenseResourceTransformer` (GradleUp#1858). * Unintended removal or (false) inclusion of shaded dependency information via `META-INF/x/y/pom.xml`/`.properties` files, which can be important for dependency/license analyzation tools. Adding the functionality of `DeduplicatingResourceTransformer` to `PreserveFirstFoundResourceTransformer` became a bit too difficult without breaking the existing behavior of the latter.
Goooler
reviewed
Nov 18, 2025
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
88316b4 to
19c2530
Compare
snazy
added a commit
to snazy/shadow
that referenced
this pull request
Nov 19, 2025
Adds a new `DeduplicatingResourceTransformer` that works different than `PreserveFirstFoundResourceTransformer`. `PreserveFirstFoundResourceTransformer` is to preserve the first resource that matches the configured paths and ignore all other ones. `DeduplicatingResourceTransformer` preserves resources by path _and_ identical content and fails for all not explicitly allowed (excluded) resources with different content. It works intentionally against all resources. The new one is intended to guard a couple of unexpected situations: * A (transitive) dependency brings a non-relocated version of a dependency that is also included elsewhere but with a different version. This could normally lead to unexpected exceptions during runtime. * Unintended inclusion or removal or legally important license information, see also `MergeLicenseResourceTransformer` (GradleUp#1858). * Unintended removal or (false) inclusion of shaded dependency information via `META-INF/x/y/pom.xml`/`.properties` files, which can be important for dependency/license analyzation tools. Adding the functionality of `DeduplicatingResourceTransformer` to `PreserveFirstFoundResourceTransformer` became a bit too difficult without breaking the existing behavior of the latter.
41d9ece to
f549d75
Compare
Goooler
reviewed
Nov 19, 2025
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
Goooler
reviewed
Nov 19, 2025
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
MergeLicenseResourceTransformer
MergeLicenseResourceTransformerMergeLicenseResourceTransformer to merge licenses
snazy
added a commit
to snazy/shadow
that referenced
this pull request
Nov 19, 2025
Adds a new `DeduplicatingResourceTransformer` that works different than `PreserveFirstFoundResourceTransformer`. `PreserveFirstFoundResourceTransformer` is to preserve the first resource that matches the configured paths and ignore all other ones. `DeduplicatingResourceTransformer` preserves resources by path _and_ identical content and fails for all not explicitly allowed (excluded) resources with different content. It works intentionally against all resources. The new one is intended to guard a couple of unexpected situations: * A (transitive) dependency brings a non-relocated version of a dependency that is also included elsewhere but with a different version. This could normally lead to unexpected exceptions during runtime. * Unintended inclusion or removal or legally important license information, see also `MergeLicenseResourceTransformer` (GradleUp#1858). * Unintended removal or (false) inclusion of shaded dependency information via `META-INF/x/y/pom.xml`/`.properties` files, which can be important for dependency/license analyzation tools. Adding the functionality of `DeduplicatingResourceTransformer` to `PreserveFirstFoundResourceTransformer` became a bit too difficult without breaking the existing behavior of the latter.
Goooler
reviewed
Nov 19, 2025
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Outdated
Show resolved
Hide resolved
...n/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformer.kt
Show resolved
Hide resolved
...m/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformerTest.kt
Outdated
Show resolved
Hide resolved
b6c9f63 to
90d4512
Compare
…nsformers/MergeLicenseResourceTransformer.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nsformers/MergeLicenseResourceTransformer.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nsformers/MergeLicenseResourceTransformer.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nsformers/MergeLicenseResourceTransformer.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nsformers/MergeLicenseResourceTransformer.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Goooler
approved these changes
Nov 19, 2025
snazy
added a commit
to snazy/shadow
that referenced
this pull request
Nov 19, 2025
Adds a new `DeduplicatingResourceTransformer` that works different than `PreserveFirstFoundResourceTransformer`. `PreserveFirstFoundResourceTransformer` is to preserve the first resource that matches the configured paths and ignore all other ones. `DeduplicatingResourceTransformer` preserves resources by path _and_ identical content and fails for all not explicitly allowed (excluded) resources with different content. It works intentionally against all resources. The new one is intended to guard a couple of unexpected situations: * A (transitive) dependency brings a non-relocated version of a dependency that is also included elsewhere but with a different version. This could normally lead to unexpected exceptions during runtime. * Unintended inclusion or removal or legally important license information, see also `MergeLicenseResourceTransformer` (GradleUp#1858). * Unintended removal or (false) inclusion of shaded dependency information via `META-INF/x/y/pom.xml`/`.properties` files, which can be important for dependency/license analyzation tools. Adding the functionality of `DeduplicatingResourceTransformer` to `PreserveFirstFoundResourceTransformer` became a bit too difficult without breaking the existing behavior of the latter.
snazy
added a commit
to snazy/shadow
that referenced
this pull request
Nov 20, 2025
Adds a new `DeduplicatingResourceTransformer` that works different than `PreserveFirstFoundResourceTransformer`. `PreserveFirstFoundResourceTransformer` is to preserve the first resource that matches the configured paths and ignore all other ones. `DeduplicatingResourceTransformer` preserves resources by path _and_ identical content and fails for all not explicitly allowed (excluded) resources with different content. It works intentionally against all resources. The new one is intended to guard a couple of unexpected situations: * A (transitive) dependency brings a non-relocated version of a dependency that is also included elsewhere but with a different version. This could normally lead to unexpected exceptions during runtime. * Unintended inclusion or removal or legally important license information, see also `MergeLicenseResourceTransformer` (GradleUp#1858). * Unintended removal or (false) inclusion of shaded dependency information via `META-INF/x/y/pom.xml`/`.properties` files, which can be important for dependency/license analyzation tools. Adding the functionality of `DeduplicatingResourceTransformer` to `PreserveFirstFoundResourceTransformer` became a bit too difficult without breaking the existing behavior of the latter.
snazy
added a commit
to snazy/shadow
that referenced
this pull request
Nov 21, 2025
Adds a new `DeduplicatingResourceTransformer` that works different than `PreserveFirstFoundResourceTransformer`. `PreserveFirstFoundResourceTransformer` is to preserve the first resource that matches the configured paths and ignore all other ones. `DeduplicatingResourceTransformer` preserves resources by path _and_ identical content and fails for all not explicitly allowed (excluded) resources with different content. It works intentionally against all resources. The new one is intended to guard a couple of unexpected situations: * A (transitive) dependency brings a non-relocated version of a dependency that is also included elsewhere but with a different version. This could normally lead to unexpected exceptions during runtime. * Unintended inclusion or removal or legally important license information, see also `MergeLicenseResourceTransformer` (GradleUp#1858). * Unintended removal or (false) inclusion of shaded dependency information via `META-INF/x/y/pom.xml`/`.properties` files, which can be important for dependency/license analyzation tools. Adding the functionality of `DeduplicatingResourceTransformer` to `PreserveFirstFoundResourceTransformer` became a bit too difficult without breaking the existing behavior of the latter.
snazy
added a commit
to snazy/shadow
that referenced
this pull request
Dec 3, 2025
Adds a new `DeduplicatingResourceTransformer` that works different than `PreserveFirstFoundResourceTransformer`. `PreserveFirstFoundResourceTransformer` is to preserve the first resource that matches the configured paths and ignore all other ones. `DeduplicatingResourceTransformer` preserves resources by path _and_ identical content and fails for all not explicitly allowed (excluded) resources with different content. It works intentionally against all resources. The new one is intended to guard a couple of unexpected situations: * A (transitive) dependency brings a non-relocated version of a dependency that is also included elsewhere but with a different version. This could normally lead to unexpected exceptions during runtime. * Unintended inclusion or removal or legally important license information, see also `MergeLicenseResourceTransformer` (GradleUp#1858). * Unintended removal or (false) inclusion of shaded dependency information via `META-INF/x/y/pom.xml`/`.properties` files, which can be important for dependency/license analyzation tools. Adding the functionality of `DeduplicatingResourceTransformer` to `PreserveFirstFoundResourceTransformer` became a bit too difficult without breaking the existing behavior of the latter.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refs #1848.