You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are upgrading from 8.x versions, please read 9.0.0 release notes first.
9
+
6
10
### Changed
7
11
8
12
- Improve the error message for empty `mainClassName`. ([#1601](https://github.com/GradleUp/shadow/pull/1601))
9
13
- Default `duplicatesStrategy` back to `EXCLUDE`. ([#1617](https://github.com/GradleUp/shadow/pull/1617))
10
14
- This strategy is consistent with 8.x series behavior, which is more compatible for most users upgrading.
11
15
- For most `ResourceTransformer` users, you need to override the strategy to `INCLUDE` to make them work.
16
+
- Strongly suggest declaring the `duplicatesStrategy` explicitly in your `ShadowJar` configuration to avoid confusion.
12
17
- See more details about the strategies at [Handling Duplicates Strategy](https://gradleup.com/shadow/configuration/merging/#handling-duplicates-strategy).
13
18
14
19
### Fixed
@@ -62,7 +67,7 @@
62
67
- Let `assemble` depend on `shadowJar`. ([#1524](https://github.com/GradleUp/shadow/pull/1524))
63
68
- Fail build when inputting AAR files or using Shadow with AGP. ([#1530](https://github.com/GradleUp/shadow/pull/1530))
This is useful when you set `shadowJar.duplicatesStrategy = DuplicatesStrategy.INCLUDE`(the default behavior) and
70
+
This is useful when you set `shadowJar.duplicatesStrategy = DuplicatesStrategy.INCLUDE` and
66
71
want to ensure that only the first found resource is included in the final JAR.
67
72
- Fail build if the ZIP entries in the shadowed JAR are duplicate. ([#1552](https://github.com/GradleUp/shadow/pull/1552))
68
73
This feature is controlled by the `shadowJar.failOnDuplicateEntries` property, which is `false` by default.
@@ -88,11 +93,12 @@
88
93
-**BREAKING CHANGE:** Change the default `duplicatesStrategy` from `EXCLUDE` to `INCLUDE`. ([#1233](https://github.com/GradleUp/shadow/pull/1233))
89
94
-`ShadowJar` recognized `EXCLUDE` as the default, but the other strategies didn't work properly.
90
95
- Now `ShadowJar` honors `INCLUDE` as the default, and aligns all the strategy behaviors with the Gradle side.
91
-
-`mergeServiceFiles` and`ServiceFileTransformer` do not work with `EXCLUDE`, as it will exclude extra service files to be merged.
96
+
-Some `ResourceTransformer`s (e.g.`ServiceFileTransformer`) do not work with `EXCLUDE`, as it will exclude duplicate resources to be merged.
92
97
- Duplicate entries might be bundled due to this change, but you can reduce them by using the newly added `PreserveFirstFoundResourceTransformer`.
93
98
- Use `filesMatching` to override the default strategy for specific files.
94
99
- Set `failOnDuplicateEntries = true` to fail the build to check for duplicate entries.
95
100
- See more details at [Handling Duplicates Strategy](https://gradleup.com/shadow/configuration/merging/#handling-duplicates-strategy).
101
+
-**Note:** The default `duplicatesStrategy` is changed back to `EXCLUDE` in 9.0.1 release.
96
102
-**BREAKING CHANGE:** Align the behavior of `ShadowTask.from` with Gradle's `AbstractCopyTask.from`. ([#1233](https://github.com/GradleUp/shadow/pull/1233))
97
103
In the previous versions, `ShadowTask.from` would always unzip the files before processing them, which caused serial
98
104
issues that are hard to fix. Now it behaves like Gradle's `AbstractCopyTask.from`, which means it will not unzip
@@ -185,10 +191,9 @@ tasks.shadowJar {
185
191
// `isEnableRelocation` has been renamed to `enableAutoRelocation`.
186
192
enableAutoRelocation =true
187
193
188
-
// The default `duplicatesStrategy` has been changed from `EXCLUDE` to `INCLUDE`.
189
-
duplicatesStrategy =DuplicatesStrategy.INCLUDE
190
-
// If you want to make `mergeServiceFiles` work, should leave the `duplicatesStrategy` as `INCLUDE`.
194
+
// If you want to make `mergeServiceFiles` work, should set the `duplicatesStrategy` as `INCLUDE`.
191
195
// `EXCLUDE` will exclude extra service files to be merged.
196
+
duplicatesStrategy =DuplicatesStrategy.INCLUDE
192
197
mergeServiceFiles()
193
198
// If you leave `duplicatesStrategy` as `INCLUDE`, you can use the new `PreserveFirstFoundResourceTransformer`
194
199
// to ensure that only the first found resource is included in the final JAR. Or duplicate entries will be bundled.
@@ -207,7 +212,7 @@ tasks.shadowJar {
207
212
208
213
If you used Shadow for merging service files, the following steps are recommended:
209
214
210
-
1. Make sure to leave `duplicatesStrategy` as default (`INCLUDE`) or `WARN`.
215
+
1. Make sure to leave `duplicatesStrategy` as `INCLUDE` or `WARN`.
211
216
2. Apply `mergeServiceFiles` or `ServiceFileTransformer` stuff as you did in your previous setup.
212
217
3. Diff the JARs from upgrading or not.
213
218
4. Remove the extra entries that are added by `INCLUDE` by `filesMatching` or `PreserveFirstFoundResourceTransformer`.
0 commit comments