Skip to content
Merged
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
31 changes: 31 additions & 0 deletions docs/configuration/dependencies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,37 @@ configuration.
}
```

### Excluding Non-JAR Transitive Dependencies

If the non-JAR file is a transitive dependency (e.g., a POM-only metapackage) that you don't actually need
in your shadowed JAR, you can exclude it using the `dependencies` block instead of embedding it.

=== "Kotlin"

```kotlin
tasks.shadowJar {
dependencies {
exclude(
// Exclude the transitive dependency on js-community, which can't be unzipped by the task.
dependency("org.graalvm.js:js-community:.*"),
)
}
}
```

=== "Groovy"

```groovy
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
dependencies {
exclude(
// Exclude the transitive dependency on js-community, which can't be unzipped by the task.
dependency('org.graalvm.js:js-community:.*'),
)
}
}
```

## Filtering Dependencies

Individual dependencies can be filtered from the final JAR by using the `dependencies` block of a
Expand Down
Loading