From 7bb14c5673a310cd38938593160483f0cfd47ceb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 02:29:22 +0000 Subject: [PATCH 1/2] Initial plan From ffae879d2789a11e612a106174a4f86a962d9516 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 02:30:52 +0000 Subject: [PATCH 2/2] docs: add exclude approach for non-JAR transitive dependencies Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com> --- docs/configuration/dependencies/README.md | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/configuration/dependencies/README.md b/docs/configuration/dependencies/README.md index 8ba2b6322..2b62f575f 100644 --- a/docs/configuration/dependencies/README.md +++ b/docs/configuration/dependencies/README.md @@ -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