Skip to content

Commit 67dd06f

Browse files
committed
Update docs about DuplicatesStrategy.INCLUDE
1 parent 936c82a commit 67dd06f

File tree

2 files changed

+6
-7
lines changed
  • docs/configuration/merging
  • src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks

2 files changed

+6
-7
lines changed

docs/configuration/merging/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,10 @@ Different strategies will lead to different results for `foo/bar` files in the J
397397

398398
- `EXCLUDE`: The **first** `foo/bar` file will be included in the final JAR.
399399
- `FAIL`: **Fail** the build with a `DuplicateFileCopyingException` if there are duplicate `foo/bar` files.
400-
- `INCLUDE`: The **last** `foo/bar` file will be included in the final JAR (the default behavior).
400+
- `INCLUDE`: Duplicate `foo/bar` entries will be included in the final JAR.
401401
- `INHERIT`: **Fail** the build with an exception like
402402
`Entry .* is a duplicate but no duplicate handling strategy has been set`.
403-
- `WARN`: The **last** `foo/bar` file will be included in the final JAR, and a warning message will be logged.
403+
- `WARN`: **Warn** about duplicates in the build log, this behaves exactly as `INHERIT` otherwise.
404404

405405
**NOTE:** The `duplicatesStrategy` takes precedence over transforming and relocating. If you mix the usages of
406406
`duplicatesStrategy` and [`ResourceTransformer`][ResourceTransformer] like below:

src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,15 @@ public abstract class ShadowJar : Jar() {
196196
/**
197197
* Returns the strategy to use when trying to copy more than one file to the same destination.
198198
*
199-
* This strategy can be overridden for individual files by using [filesMatching].
199+
* This global strategy can be overridden for individual files by using [filesMatching].
200200
*
201-
* The default value is [INCLUDE]. Different strategies will lead to different results for
202-
* `foo/bar` files in the JARs to be merged:
201+
* The default value is [INCLUDE]. Different strategies will lead to different results for `foo/bar` files in the JARs to be merged:
203202
*
204203
* - [EXCLUDE]: The **first** `foo/bar` file will be included in the final JAR.
205204
* - [FAIL]: **Fail** the build with a `DuplicateFileCopyingException` if there are duplicate `foo/bar` files.
206-
* - [INCLUDE]: The **last** `foo/bar` file will be included in the final JAR (the default behavior).
205+
* - [INCLUDE]: Duplicate `foo/bar` entries will be included in the final JAR.
207206
* - [INHERIT]: **Fail** the build with an exception like `Entry .* is a duplicate but no duplicate handling strategy has been set`.
208-
* - [WARN]: The **last** `foo/bar` file will be included in the final JAR, and a warning message will be logged.
207+
* - [WARN]: **Warn** about duplicates in the build log, this behaves exactly as [INHERIT] otherwise.
209208
*
210209
* **NOTE:** The strategy takes precedence over transforming and relocating.
211210
* Some [ResourceTransformer]s like [ServiceFileTransformer] will not work as expected with setting the strategy to

0 commit comments

Comments
 (0)