Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/configuration/merging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ Alternatively, you can follow these steps:

Optional steps:

- Enable [`ShadowJar.failOnDuplicateEntries`][ShadowJar.failOnDuplicateEntries] to check duplicate entries in the final JAR.
This can also ensure the regressions are caught in the future.
- [`ShadowJar.failOnDuplicateEntries`][ShadowJar.failOnDuplicateEntries] is enabled by default to check duplicate entries in the final JAR.
This can also ensure the regressions are caught in the future. Disable it if you want to allow duplicate entries.
- Use [Diffuse](https://github.com/JakeWharton/diffuse) to diff the JARs.

Here are some examples:
Expand Down Expand Up @@ -144,8 +144,8 @@ Here are some examples:
}

tasks.shadowJar {
// Optional step.
failOnDuplicateEntries = true
// Optional step: disable it if you want to allow duplicate entries.
failOnDuplicateEntries = false
}
```

Expand Down Expand Up @@ -185,8 +185,8 @@ Here are some examples:
}

tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
// Optional step.
failOnDuplicateEntries = true
// Optional step: disable it if you want to allow duplicate entries.
failOnDuplicateEntries = false
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ public abstract class ShadowJar : Jar() {
* - Usually used with setting [getDuplicatesStrategy] to [INCLUDE] or [WARN].
* - It provides a stricter check before the JAR is created.
*
* Defaults to `false`.
* Defaults to `true`.
*/
@get:Input
@get:Option(
option = "fail-on-duplicate-entries",
description = "Fails build if the ZIP entries in the shadowed JAR are duplicate.",
)
public open val failOnDuplicateEntries: Property<Boolean> = objectFactory.property(false)
public open val failOnDuplicateEntries: Property<Boolean> = objectFactory.property(true)

/**
* Adds the [java.util.jar.Attributes.Name.MULTI_RELEASE] attribute to the manifest of the shadow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class ShadowPropertiesTest {
assertThat(addMultiReleaseAttribute.get()).isTrue()
assertThat(enableAutoRelocation.get()).isFalse()
assertThat(enableKotlinModuleRemapping.get()).isTrue()
assertThat(failOnDuplicateEntries.get()).isFalse()
assertThat(failOnDuplicateEntries.get()).isTrue()
assertThat(minimizeJar.get()).isFalse()
assertThat(mainClass.orNull).isNull()

Expand Down