Skip to content

Commit 0686a8f

Browse files
GooolerCopilot
andauthored
Prepare changelog for 9.0.1 and polish the items of 9.0.0 (#1621)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 75a8688 commit 0686a8f

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

docs/changes/README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33

44
## [Unreleased](https://github.com/GradleUp/shadow/compare/9.0.0...HEAD) - 2025-xx-xx
55

6+
!!! note
7+
8+
If you are upgrading from 8.x versions, please read 9.0.0 release notes first.
9+
610
### Changed
711

812
- Improve the error message for empty `mainClassName`. ([#1601](https://github.com/GradleUp/shadow/pull/1601))
913
- Default `duplicatesStrategy` back to `EXCLUDE`. ([#1617](https://github.com/GradleUp/shadow/pull/1617))
1014
- This strategy is consistent with 8.x series behavior, which is more compatible for most users upgrading.
1115
- 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.
1217
- See more details about the strategies at [Handling Duplicates Strategy](https://gradleup.com/shadow/configuration/merging/#handling-duplicates-strategy).
1318

1419
### Fixed
@@ -62,7 +67,7 @@
6267
- Let `assemble` depend on `shadowJar`. ([#1524](https://github.com/GradleUp/shadow/pull/1524))
6368
- Fail build when inputting AAR files or using Shadow with AGP. ([#1530](https://github.com/GradleUp/shadow/pull/1530))
6469
- Add `PreserveFirstFoundResourceTransformer`. ([#1548](https://github.com/GradleUp/shadow/pull/1548))
65-
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
6671
want to ensure that only the first found resource is included in the final JAR.
6772
- Fail build if the ZIP entries in the shadowed JAR are duplicate. ([#1552](https://github.com/GradleUp/shadow/pull/1552))
6873
This feature is controlled by the `shadowJar.failOnDuplicateEntries` property, which is `false` by default.
@@ -88,11 +93,12 @@
8893
- **BREAKING CHANGE:** Change the default `duplicatesStrategy` from `EXCLUDE` to `INCLUDE`. ([#1233](https://github.com/GradleUp/shadow/pull/1233))
8994
- `ShadowJar` recognized `EXCLUDE` as the default, but the other strategies didn't work properly.
9095
- 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.
9297
- Duplicate entries might be bundled due to this change, but you can reduce them by using the newly added `PreserveFirstFoundResourceTransformer`.
9398
- Use `filesMatching` to override the default strategy for specific files.
9499
- Set `failOnDuplicateEntries = true` to fail the build to check for duplicate entries.
95100
- 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.
96102
- **BREAKING CHANGE:** Align the behavior of `ShadowTask.from` with Gradle's `AbstractCopyTask.from`. ([#1233](https://github.com/GradleUp/shadow/pull/1233))
97103
In the previous versions, `ShadowTask.from` would always unzip the files before processing them, which caused serial
98104
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 {
185191
// `isEnableRelocation` has been renamed to `enableAutoRelocation`.
186192
enableAutoRelocation = true
187193

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`.
191195
// `EXCLUDE` will exclude extra service files to be merged.
196+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
192197
mergeServiceFiles()
193198
// If you leave `duplicatesStrategy` as `INCLUDE`, you can use the new `PreserveFirstFoundResourceTransformer`
194199
// 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 {
207212

208213
If you used Shadow for merging service files, the following steps are recommended:
209214

210-
1. Make sure to leave `duplicatesStrategy` as default (`INCLUDE`) or `WARN`.
215+
1. Make sure to leave `duplicatesStrategy` as `INCLUDE` or `WARN`.
211216
2. Apply `mergeServiceFiles` or `ServiceFileTransformer` stuff as you did in your previous setup.
212217
3. Diff the JARs from upgrading or not.
213218
4. Remove the extra entries that are added by `INCLUDE` by `filesMatching` or `PreserveFirstFoundResourceTransformer`.

0 commit comments

Comments
 (0)