From c63f1c432689ad50ffb1dd5d71682da9968ac5bb Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 24 Aug 2026 12:19:48 +0800 Subject: [PATCH 01/11] Wrap long lines in documentation --- README.md | 12 +- docs/README.md | 35 +++-- docs/about/README.md | 19 +-- docs/android-plugins/README.md | 1 - docs/application-plugin/README.md | 19 ++- docs/configuration/README.md | 46 +++---- docs/configuration/dependencies/README.md | 25 ++-- docs/configuration/filtering/README.md | 7 +- docs/configuration/merging/README.md | 120 +++++++++--------- docs/configuration/minimizing/README.md | 35 +++-- docs/configuration/relocation/README.md | 47 ++++--- .../reproducible-builds/README.md | 1 - docs/custom-tasks/README.md | 13 +- docs/getting-started/README.md | 11 +- docs/images/logo.orig.svg | 2 +- docs/kotlin-plugins/README.md | 11 +- docs/multi-project/README.md | 16 +-- docs/publishing/README.md | 52 ++++---- 18 files changed, 218 insertions(+), 254 deletions(-) diff --git a/README.md b/README.md index f7c2995781..a69e15e93d 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ with R8/ProGuard. The Gradle counterpart to Maven Shade Plugin. > [!NOTE]\ > Previously this plugin was developed by [@johnrengelman](https://github.com/johnrengelman) and published under the -> ID [`com.github.johnrengelman.shadow`][johnrengelman's] -> before maintenance was transferred to the [GradleUp organization](https://github.com/GradleUp) to ensure future -> development, see [#908](https://github.com/GradleUp/shadow/issues/908). +> ID [`com.github.johnrengelman.shadow`][johnrengelman's] before maintenance was transferred to the +> [GradleUp organization](https://github.com/GradleUp) to ensure future development, see +> [#908](https://github.com/GradleUp/shadow/issues/908). > -> If you are still using the old plugin ID in your build script, we recommend to switch to the new plugin ID [ -`com.gradleup.shadow`][gradleup's] -> and update to the latest version to receive all the latest bug fixes and improvements. +> If you are still using the old plugin ID in your build script, we recommend to switch to the new plugin ID +> [`com.gradleup.shadow`][gradleup's] and update to the latest version to receive all the latest bug fixes and +> improvements. ## Documentation diff --git a/docs/README.md b/docs/README.md index 65b44fd7d8..67e5fdffe2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,18 +4,18 @@ # Introduction -A Gradle plugin for creating fat/uber JARs, transforming files, relocating packages, and optimizing applications -with R8/ProGuard. The Gradle counterpart to Maven Shade Plugin. +A Gradle plugin for creating fat/uber JARs, transforming files, relocating packages, and optimizing applications with +R8/ProGuard. The Gradle counterpart to Maven Shade Plugin. !!! warning "Plugin ID Change" Previously this plugin was developed by [@johnrengelman][johnrengelman] and published under the ID [`com.github.johnrengelman.shadow`][johnrengelman's] before maintenance was transferred to the [GradleUp organization][GradleUp] to ensure future development, see [#908]. - + If you are still using the old plugin ID in your build script, we recommend to switch to the new plugin ID - [`com.gradleup.shadow`][gradleup's] and update to the latest version to receive all the latest bug fixes - and improvements. + [`com.gradleup.shadow`][gradleup's] and update to the latest version to receive all the latest bug fixes and + improvements. | Shadow Version | Min Gradle Version | Min Java Version | Plugin ID | |----------------|--------------------|------------------|------------------------------------------------------| @@ -37,15 +37,12 @@ Shadowing a project output has 2 major use cases: ### Executable Distributions Executable distribution is the main use case for deploying an _application_ that can be executed/run in the runtime -environment. -In the case of Shadow, this is a single _uber_ or _fat_ JAR. -The JAR file contains all the application code and dependent libraries to execute (not including the standard JVM -libraries). -The shadow JAR does **not** include the JRE itself. -It must be available on the target system. +environment. In the case of Shadow, this is a single _uber_ or _fat_ JAR. The JAR file contains all the application code +and dependent libraries to execute (not including the standard JVM libraries). The shadow JAR does **not** include the +JRE itself. It must be available on the target system. -Executable JARs contain a JAR MANIFEST that specifies the application Main Class. -This allows the application to be started with a single command: +Executable JARs contain a JAR MANIFEST that specifies the application Main Class. This allows the application to be +started with a single command: ```shell java -jar application-shadow.jar @@ -53,18 +50,16 @@ java -jar application-shadow.jar ### Library Bundling -Dependency bundling and relocation is the main use case for _library_ authors. -The goal of a bundled library is to create a pre-packaged dependency for other libraries or applications to utilize. -Often in these scenarios, a library may contain a dependency that a downstream library or application also uses. -In _some_ cases, different versions of this common dependency can cause an issue in either the upstream library or -the downstream application. -These issues often manifest themselves as binary incompatibilities in either the library or application code. +Dependency bundling and relocation is the main use case for _library_ authors. The goal of a bundled library is to +create a pre-packaged dependency for other libraries or applications to utilize. Often in these scenarios, a library may +contain a dependency that a downstream library or application also uses. In _some_ cases, different versions of this +common dependency can cause an issue in either the upstream library or the downstream application. These issues often +manifest themselves as binary incompatibilities in either the library or application code. By utilizing Shadow's ability to _relocate_ the package names for dependencies, a library author can ensure that the library's dependencies will not conflict with the same dependency being declared by the downstream application. - [johnrengelman's]: https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow [gradleup's]: https://plugins.gradle.org/plugin/com.gradleup.shadow [johnrengelman]: https://github.com/johnrengelman diff --git a/docs/about/README.md b/docs/about/README.md index 538a31dbf7..e383a687cf 100644 --- a/docs/about/README.md +++ b/docs/about/README.md @@ -1,20 +1,16 @@ # About This Project I (John Engelman) started this project in December 2012. We were working on converting from a monolithic application -into the new hot jazz of "microservices" using Dropwizard. -I had also just started learning about Gradle and I knew that the incremental build system it provided would benefit -our development team greatly. -Unfortunately, the closest thing that Gradle had to Maven Shade Plugin was its ability to create application TARs and -ZIPs. +into the new hot jazz of "microservices" using Dropwizard. I had also just started learning about Gradle and I knew that +the incremental build system it provided would benefit our development team greatly. Unfortunately, the closest thing +that Gradle had to Maven Shade Plugin was its ability to create application TARs and ZIPs. -So, Charlie Knudsen and I set out to port the existing Shade code into a Gradle plugin. -This port is what existed up until the `0.9` milestone releases for Shadow. -It functioned, but it wasn't idiomatic Gradle by any means. +So, Charlie Knudsen and I set out to port the existing Shade code into a Gradle plugin. This port is what existed up +until the `0.9` milestone releases for Shadow. It functioned, but it wasn't idiomatic Gradle by any means. Starting with 0.9, Shadow was rewritten from the ground up as standard Gradle plugin and leveraged as much of Gradle's -classes and concepts as possible. -At the same time as the 0.9 release, Gradle was announcing the [Gradle Plugin Portal][gradle-plugin-portal] and -so Shadow was published there. +classes and concepts as possible. At the same time as the 0.9 release, Gradle was announcing +the [Gradle Plugin Portal][gradle-plugin-portal] and so Shadow was published there. ## Maintainers @@ -28,7 +24,6 @@ so Shadow was published there. - [gradle-plugin-portal]: https://plugins.gradle.org [john-engelman]: https://github.com/johnrengelman [zongle-wang]: https://github.com/Goooler diff --git a/docs/android-plugins/README.md b/docs/android-plugins/README.md index afe0bc5e8b..3994300b89 100644 --- a/docs/android-plugins/README.md +++ b/docs/android-plugins/README.md @@ -4,5 +4,4 @@ Now you can bundle and publish multiple Android libraries as one with [Android Fused Library Plugin][android-fused-library-plugin], which is officially supported by Android. - [android-fused-library-plugin]: https://developer.android.com/build/publish-library/fused-library diff --git a/docs/application-plugin/README.md b/docs/application-plugin/README.md index 5767dcc6a7..0a1712a76e 100644 --- a/docs/application-plugin/README.md +++ b/docs/application-plugin/README.md @@ -3,9 +3,9 @@ Shadow reacts to the presence of Gradle's [`application`][application] plugin and will automatically configure additional tasks for running the shadowed JAR and creating distributions containing the shadowed JAR. -Just like the normal [`Jar`][Jar] task, when the [`application`][application] plugin is applied, -the [`ShadowJar`][ShadowJar] manifest will be configured to contain the `Main-Class` attribute with the value specified -in the project's `application.mainClass` attribute. +Just like the normal [`Jar`][Jar] task, when the [`application`][application] plugin is applied, the [ +`ShadowJar`][ShadowJar] manifest will be configured to contain the `Main-Class` attribute with the value specified in +the project's `application.mainClass` attribute. === "Kotlin" @@ -35,10 +35,9 @@ in the project's `application.mainClass` attribute. ## Running the Shadow JAR -When applied along with the `application` plugin, the `runShadow` task will be created for starting -the application from the shadowed JAR. -The `runShadow` task is a [`JavaExec`][JavaExec] task that is configured to execute `java -jar myproject-all.jar`. -It can be configured the same as any other [`JavaExec`][JavaExec] task. +When applied along with the `application` plugin, the `runShadow` task will be created for starting the application from +the shadowed JAR. The `runShadow` task is a [`JavaExec`][JavaExec] task that is configured to execute +`java -jar myproject-all.jar`. It can be configured the same as any other [`JavaExec`][JavaExec] task. === "Kotlin" @@ -81,9 +80,8 @@ It can be configured the same as any other [`JavaExec`][JavaExec] task. ## Distributing the Shadow JAR The Shadow plugin will also configure distribution tasks when in the presence of the [`application`][application] -plugin. The plugin will create `shadowDistZip` and `shadowDistTar` which creates Zip and Tar distributions -respectively. Each distribution will contain the shadowed JAR file along with the necessary start scripts to launch -the application. +plugin. The plugin will create `shadowDistZip` and `shadowDistTar` which creates Zip and Tar distributions respectively. +Each distribution will contain the shadowed JAR file along with the necessary start scripts to launch the application. Additionally, the plugin will create the `installShadowDist` and `startShadowScripts` tasks which stages the necessary files for a distribution to `build/install/-shadow/`. @@ -169,7 +167,6 @@ You can also add more files into the distribution like: View [The Distribution Plugin][distribution-plugin] for more information about configuring distributions. - [Jar]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html [JavaExec]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.JavaExec.html [ShadowJar]: ../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html diff --git a/docs/configuration/README.md b/docs/configuration/README.md index d50f6ef5eb..1507a9a1e3 100644 --- a/docs/configuration/README.md +++ b/docs/configuration/README.md @@ -1,12 +1,12 @@ # Configuring Shadow -The [`ShadowJar`][ShadowJar] task type extends from Gradle's [`Jar`][Jar] type. -This means that all attributes and methods available on [`Jar`][Jar] are also available on [`ShadowJar`][ShadowJar]. +The [`ShadowJar`][ShadowJar] task type extends from Gradle's [`Jar`][Jar] type. This means that all attributes and +methods available on [`Jar`][Jar] are also available on [`ShadowJar`][ShadowJar]. ## ShadowJar Execution Flow -The following diagram illustrates how the `shadowJar` task processes inputs from dependency configurations -and source files to the final shadowed output JAR: +The following diagram illustrates how the `shadowJar` task processes inputs from dependency configurations and source +files to the final shadowed output JAR: ```mermaid flowchart TD @@ -98,22 +98,19 @@ This will result in the output file being named `myApp-all.jar` instead of `myAp ## Configuring the Runtime Classpath -Each Java JAR file contains a manifest file that provides metadata about the contents of the JAR file itself. -When using a shadowed JAR file as an executable JAR, it is assumed that all necessary runtime classes are contained -within the JAR itself. -There may be situations where the desire is to **not** bundle select dependencies into the shadowed JAR file, but -they are still required for runtime execution. +Each Java JAR file contains a manifest file that provides metadata about the contents of the JAR file itself. When using +a shadowed JAR file as an executable JAR, it is assumed that all necessary runtime classes are contained within the JAR +itself. There may be situations where the desire is to **not** bundle select dependencies into the shadowed JAR file, +but they are still required for runtime execution. -In these scenarios, Shadow creates a `shadow` configuration to declare these dependencies. -Dependencies added to the `shadow` configuration are **not** bundled into the output JAR. -Think of `configurations.shadow` as unmerged, runtime dependencies. -The integration with the [`maven-publish`][maven-publish] plugin will automatically configure dependencies added -to `configurations.shadow` as `RUNTIME` scope dependencies in the resulting POM file. +In these scenarios, Shadow creates a `shadow` configuration to declare these dependencies. Dependencies added to the +`shadow` configuration are **not** bundled into the output JAR. Think of `configurations.shadow` as unmerged, runtime +dependencies. The integration with the [`maven-publish`][maven-publish] plugin will automatically configure dependencies +added to `configurations.shadow` as `RUNTIME` scope dependencies in the resulting POM file. Additionally, Shadow automatically configures the manifest of the [`ShadowJar`][ShadowJar] task to contain a -`Class-Path` entry in the JAR manifest. -The value of the `Class-Path` entry is the name of all dependencies resolved in the `shadow` configuration for the -project. +`Class-Path` entry in the JAR manifest. The value of the `Class-Path` entry is the name of all dependencies resolved in +the `shadow` configuration for the project. === "Kotlin" @@ -144,8 +141,8 @@ Class-Path: junit-3.8.2.jar ## Configuring the JAR Manifest -The [`ShadowJar`][ShadowJar] manifest is configured in a number of ways. First, the manifest for the `shadowJar` task -is configured to __inherit__ from the manifest of the standard `jar` task. +The [`ShadowJar`][ShadowJar] manifest is configured in a number of ways. First, the manifest for the `shadowJar` task is +configured to __inherit__ from the manifest of the standard `jar` task. === "Kotlin" @@ -206,8 +203,8 @@ configure the upstream. ## Adding Multi-Release Manifest Attribute -The [`ShadowJar`][ShadowJar] task can automatically add the `Multi-Release` attribute to the JAR manifest if any of -the included dependencies contain this attribute. This is controlled by the `addMultiReleaseAttribute` property. +The [`ShadowJar`][ShadowJar] task can automatically add the `Multi-Release` attribute to the JAR manifest if any of the +included dependencies contain this attribute. This is controlled by the `addMultiReleaseAttribute` property. By default, `addMultiReleaseAttribute` is set to `true`. When enabled, Shadow will scan all dependencies being merged into the shadow JAR. If any dependency JAR has the `Multi-Release` manifest attribute set to `true`, Shadow will add @@ -231,12 +228,12 @@ You can disable this behavior by setting `addMultiReleaseAttribute` to `false`: } ``` -This is useful if you want to control the presence of the `Multi-Release` attribute manually or avoid inheriting it -from dependencies. +This is useful if you want to control the presence of the `Multi-Release` attribute manually or avoid inheriting it from +dependencies. ## Adding Extra Files -The [`ShadowJar`][ShadowJar] task is a subclass of the [`Jar`][Jar] task, which means that the[`Jar.from`][Jar.from] +The [`ShadowJar`][ShadowJar] task is a subclass of the [`Jar`][Jar] task, which means that the [`Jar.from`][Jar.from] method can be used to add extra files. === "Kotlin" @@ -264,7 +261,6 @@ method can be used to add extra files. See also [Embedding Local Jar Files Into Your Shadowed Jar][embedding-local-jar-files-into-your-shadowed-jar]. - [Jar.from]: https://docs.gradle.org/current/dsl/org.gradle.jvm.tasks.Jar.html#org.gradle.jvm.tasks.Jar:from(java.lang.Object,%20org.gradle.api.Action) [Jar]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html [ShadowJar]: ../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html diff --git a/docs/configuration/dependencies/README.md b/docs/configuration/dependencies/README.md index 013737a4d9..642ecfbce6 100644 --- a/docs/configuration/dependencies/README.md +++ b/docs/configuration/dependencies/README.md @@ -22,17 +22,18 @@ merging can be configured using the [`configurations`][ShadowJar.configurations] ``` The above code sample would configure the [`ShadowJar`][ShadowJar] task to merge dependencies from only the -`compileClasspath` configuration. -This means any dependency declared in the `runtimeOnly` configuration would be **not** be included in the final JAR. +`compileClasspath` configuration. This means any dependency declared in the `runtimeOnly` configuration would be **not** +be included in the final JAR. !!! warning "Required Configuration" Note the literal use of [`project.configurations`][Project.configurations] when setting the [`configurations`][ShadowJar.configurations] attribute of a [`ShadowJar`][ShadowJar] task. - This is **required**. It may be tempting to specify `configurations = [configurations.compileClasspath]` but this will - not have the intended effect, as `configurations.compile` will try to delegate to the - [`configurations`][ShadowJar.configurations] property of the [`ShadowJar`][ShadowJar] task instead of the `project`. + This is **required**. It may be tempting to specify `configurations = [configurations.compileClasspath]` but + this will not have the intended effect, as `configurations.compile` will try to delegate to the + [`configurations`][ShadowJar.configurations] property of the [`ShadowJar`][ShadowJar] task instead of the + `project`. ## Embedding Local Jar Files into Your Shadowed JAR @@ -169,8 +170,8 @@ 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. +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" @@ -201,8 +202,8 @@ in your shadowed JAR, you can exclude it using the `dependencies` block instead ## Filtering Dependencies Individual dependencies can be filtered from the final JAR by using the `dependencies` block of a -[`ShadowJar`][ShadowJar] task. Dependency filtering does **not** apply to transitive dependencies. -That is, excluding a dependency does not exclude any of its dependencies from the final JAR. +[`ShadowJar`][ShadowJar] task. Dependency filtering does **not** apply to transitive dependencies. That is, excluding a +dependency does not exclude any of its dependencies from the final JAR. The `dependency` blocks provides a number of methods for resolving dependencies using the notations familiar from Gradle's [`project.configurations`][Project.configurations] block. @@ -271,9 +272,8 @@ Gradle's [`project.configurations`][Project.configurations] block. ### Using Regex Patterns to Filter Dependencies -Dependencies can be filtered using regex patterns. -Coupled with the `::` notation for dependencies, this allows for excluding/including -using any of these individual fields. +Dependencies can be filtered using regex patterns. Coupled with the `::` notation for +dependencies, this allows for excluding/including using any of these individual fields. === "Kotlin" @@ -479,7 +479,6 @@ block provides a method that accepts a `Closure` for selecting dependencies. ``` - [Jar.from]: https://docs.gradle.org/current/dsl/org.gradle.jvm.tasks.Jar.html#org.gradle.jvm.tasks.Jar:from(java.lang.Object,%20org.gradle.api.Action) [Jar]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html [ShadowJar.configurations]: ../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/configurations.html diff --git a/docs/configuration/filtering/README.md b/docs/configuration/filtering/README.md index e60e109372..85c8c95146 100644 --- a/docs/configuration/filtering/README.md +++ b/docs/configuration/filtering/README.md @@ -3,9 +3,9 @@ The final contents of a shadow JAR can be filtered using the `exclude` and `include` methods inherited from Gradle's [`Jar`][Jar] task type. -When using `exclude`/`include` with a [`ShadowJar`][ShadowJar] task, the resulting copy specs are applied to the -_final_ JAR contents. This means that, the configuration is applied to the individual files from both the project -source set or _any_ of the dependencies to be merged. +When using `exclude`/`include` with a [`ShadowJar`][ShadowJar] task, the resulting copy specs are applied to the _final_ +JAR contents. This means that, the configuration is applied to the individual files from both the project source set or +_any_ of the dependencies to be merged. === "Kotlin" @@ -47,6 +47,5 @@ Excludes and includes can be combined just like a normal [`Jar`][Jar] task, with ``` - [Jar]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html [ShadowJar]: ../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html diff --git a/docs/configuration/merging/README.md b/docs/configuration/merging/README.md index d864fc9a7b..e82de77874 100644 --- a/docs/configuration/merging/README.md +++ b/docs/configuration/merging/README.md @@ -11,7 +11,8 @@ should process a particular entry and apply any modifications before writing the [`ResourceTransformer`][ResourceTransformer] follows a guaranteed processing order: 1. **Project files first**: All files in projects are processed before any dependency files. - 2. **Dependency files second**: Files from configurations (runtime dependencies) or added via [`ShadowJar.from`][ShadowJar.from] are processed after project files. + 2. **Dependency files second**: Files from configurations (runtime dependencies) or added via + [`ShadowJar.from`][ShadowJar.from] are processed after project files. This ordering is crucial when merging configuration files where you want to preserve project-specific values while merging in additional data from dependencies. @@ -93,7 +94,9 @@ as expected because duplicate resource files are filtered out and dropped by Gra If Shadow detects a resource matched by a built-in [`ResourceTransformer`][ResourceTransformer] while its `duplicatesStrategy` is `EXCLUDE`, it will log a warning during the build: - 'META-INF/services/foo' is matched by com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer but its DuplicatesStrategy is EXCLUDE — duplicates may be silently dropped before the transformer processes them. + 'META-INF/services/foo' is matched by + com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer but its DuplicatesStrategy is + EXCLUDE — duplicates may be silently dropped before the transformer processes them. Set it to INCLUDE or WARN to ensure all duplicates are processed by the transformer. Want [`ResourceTransformer`][ResourceTransformer]s and `duplicatesStrategy` to work together? There are several common @@ -103,7 +106,8 @@ steps to take: 2. Apply your [`ResourceTransformer`][ResourceTransformer]s. 3. Remove duplicate entries by - overriding the default strategy for specific files to `EXCLUDE` or `FAIL` using - [`filesMatching`][Jar.filesMatching], [`filesNotMatching`][Jar.filesNotMatching], or [`eachFile`][Jar.eachFile] functions + [`filesMatching`][Jar.filesMatching], [`filesNotMatching`][Jar.filesNotMatching], or [`eachFile`][Jar.eachFile] + functions - or applying [`PreserveFirstFoundResourceTransformer`][PreserveFirstFoundResourceTransformer] for specific files - or write your own [`ResourceTransformer`][ResourceTransformer] to handle duplicates - or mechanism similar. @@ -113,17 +117,18 @@ Alternatively, you can follow these steps: 1. Set the default strategy to `EXCLUDE` or `FAIL`. 2. Apply your [`ResourceTransformer`][ResourceTransformer]s. 3. Bypass the duplicate entries which should be handled by the [`ResourceTransformer`][ResourceTransformer]s using - [`filesMatching`][Jar.filesMatching], [`filesNotMatching`][Jar.filesNotMatching], or [`eachFile`][Jar.eachFile] functions - to set their `duplicatesStrategy` to `INCLUDE` or `WARN`. + [`filesMatching`][Jar.filesMatching], [`filesNotMatching`][Jar.filesNotMatching], or [`eachFile`][Jar.eachFile] + functions to set their `duplicatesStrategy` to `INCLUDE` or `WARN`. !!! warning "Build Cache Impact" - Functions inherited from [`CopySpec`][CopySpec], such as [`filesMatching`][Jar.filesMatching], [`filesNotMatching`][Jar.filesNotMatching], [`eachFile`][Jar.eachFile], or others, disable the output caching. + Functions inherited from [`CopySpec`][CopySpec], such as [`filesMatching`][Jar.filesMatching], + [`filesNotMatching`][Jar.filesNotMatching], [`eachFile`][Jar.eachFile], or others, disable the output caching. 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. +- Enable [`ShadowJar.failOnDuplicateEntries`][ShadowJar.failOnDuplicateEntries] to check duplicate entries in the final + JAR. This can also ensure the regressions are caught in the future. - Use [Diffuse][Diffuse] to diff the JARs. Here are some examples: @@ -318,16 +323,16 @@ can also be provided. ## Merging Service Descriptor Files -Java libraries often contain service descriptors files in the `META-INF/services` directory of the JAR. -A service descriptor typically contains a line delimited list of classes that are supported for a particular _service_. -At runtime, this file is read and used to configure library or application behavior. +Java libraries often contain service descriptors files in the `META-INF/services` directory of the JAR. A service +descriptor typically contains a line delimited list of classes that are supported for a particular _service_. At +runtime, this file is read and used to configure library or application behavior. -Multiple dependencies may use the same service descriptor file name. -In this case, it is generally desired to merge the content of each instance of the file into a single output file. -The [`ServiceFileTransformer`][ServiceFileTransformer] class is used to perform this merging. -By default, it will merge each copy of a file under `META-INF/services` into a single file in the output JAR. -You can use either the short syntax method [`mergeServiceFiles()`][ShadowJar.mergeServiceFiles] or the full syntax -method [`transform`][ShadowJar.transform] to add the [`ServiceFileTransformer`][ServiceFileTransformer]: +Multiple dependencies may use the same service descriptor file name. In this case, it is generally desired to merge the +content of each instance of the file into a single output file. The [`ServiceFileTransformer`][ServiceFileTransformer] +class is used to perform this merging. By default, it will merge each copy of a file under `META-INF/services` into a +single file in the output JAR. You can use either the short syntax method [ +`mergeServiceFiles()`][ShadowJar.mergeServiceFiles] or the full syntax method [`transform`][ShadowJar.transform] to add +the [`ServiceFileTransformer`][ServiceFileTransformer]: === "Kotlin" @@ -355,11 +360,12 @@ method [`transform`][ShadowJar.transform] to add the [`ServiceFileTransformer`][ !!! note "Groovy Extension Modules" - Groovy Extension Module descriptor files (located at `META-INF/services/org.codehaus.groovy.runtime.ExtensionModule`) - are ignored by the [`ServiceFileTransformer`][ServiceFileTransformer]. + Groovy Extension Module descriptor files (located at + `META-INF/services/org.codehaus.groovy.runtime.ExtensionModule`) are ignored by the + [`ServiceFileTransformer`][ServiceFileTransformer]. This is due to these files having a different syntax than standard service descriptor files. - Use the [`mergeGroovyExtensionModules()`][mergeGroovyExtensionModules] method to merge - these files if your dependencies contain them. + Use the [`mergeGroovyExtensionModules()`][mergeGroovyExtensionModules] method to merge these files if your + dependencies contain them. ### Configuring the Location of Service Descriptor Files @@ -437,10 +443,10 @@ from merging. ## Merging Groovy Extension Modules -Shadow provides a specific transformer for dealing with Groovy extension module files. -This is due to their special syntax and how they need to be merged together. -The [`GroovyExtensionModuleTransformer`][GroovyExtensionModuleTransformer] will handle these files. -The [`ShadowJar`][ShadowJar] task also provides a short syntax method to add this transformer. +Shadow provides a specific transformer for dealing with Groovy extension module files. This is due to their special +syntax and how they need to be merged together. The [ +`GroovyExtensionModuleTransformer`][GroovyExtensionModuleTransformer] will handle these files. The [ +`ShadowJar`][ShadowJar] task also provides a short syntax method to add this transformer. === "Kotlin" @@ -470,8 +476,8 @@ The [`ShadowJar`][ShadowJar] task also provides a short syntax method to add thi [`Log4j2PluginsCacheFileTransformer`][Log4j2PluginsCacheFileTransformer] is a [`ResourceTransformer`][ResourceTransformer] that merges -`META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat` plugin caches from all the jars -containing Log4j 2.x Core components. It's a Gradle equivalent of +`META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat` plugin caches from all the jars containing +Log4j 2.x Core components. It's a Gradle equivalent of [Log4j Plugin Descriptor Transformer][log4j-plugin-descriptor-transformer]. === "Kotlin" @@ -492,10 +498,9 @@ containing Log4j 2.x Core components. It's a Gradle equivalent of ## Appending Text Files -Generic text files can be appended together using the [`AppendingTransformer`][AppendingTransformer]. -Each file is appended using separators (defaults to `\n`) to separate content. -The [`ShadowJar`][ShadowJar] task provides a short syntax method of [`append(String)`][ShadowJar.append] to configure -this transformer. +Generic text files can be appended together using the [`AppendingTransformer`][AppendingTransformer]. Each file is +appended using separators (defaults to `\n`) to separate content. The [`ShadowJar`][ShadowJar] task provides a short +syntax method of [`append(String)`][ShadowJar.append] to configure this transformer. === "Kotlin" @@ -543,10 +548,10 @@ this transformer. ## Appending XML Files -XML files require a special transformer for merging. The [`XmlAppendingTransformer`][XmlAppendingTransformer] -reads each XML document and merges each root element into a single document. -There is no short syntax method for the [`XmlAppendingTransformer`][XmlAppendingTransformer]. -It must be added using the [`transform`][ShadowJar.transform] methods. +XML files require a special transformer for merging. The [`XmlAppendingTransformer`][XmlAppendingTransformer] reads +each XML document and merges each root element into a single document. There is no short syntax method for the +[`XmlAppendingTransformer`][XmlAppendingTransformer]. It must be added using the [`transform`][ShadowJar.transform] +methods. === "Kotlin" @@ -570,11 +575,10 @@ It must be added using the [`transform`][ShadowJar.transform] methods. ## Merging R8/ProGuard Rule Files -Dependencies may publish ProGuard or R8 rules under `META-INF/proguard`. -When multiple dependencies have files with the same name under `META-INF/proguard`, -the [`ProGuardFilesResourceTransformer`][ProGuardFilesResourceTransformer] merges them into a single file in the -output JAR, while retaining distinct file names for non-conflicting rules. It also relocates matched class names -and package patterns within the rules according to configured relocators. +Dependencies may publish ProGuard or R8 rules under `META-INF/proguard`. When multiple dependencies have files with the +same name under `META-INF/proguard`, the [`ProGuardFilesResourceTransformer`][ProGuardFilesResourceTransformer] merges +them into a single file in the output JAR, while retaining distinct file names for non-conflicting rules. It also +relocates matched class names and package patterns within the rules according to configured relocators. You can add this transformer using [`transform`][ShadowJar.transform]: @@ -682,14 +686,14 @@ strategies using `mappings`, rewrite property keys using `keyTransformer`, or ch ## Merging License Files -When multiple dependencies contain license files (such as `META-INF/LICENSE*` or `LICENSE*`), you can merge them into -a single license file in the output JAR using the [`MergeLicenseResourceTransformer`][MergeLicenseResourceTransformer]. +When multiple dependencies contain license files (such as `META-INF/LICENSE*` or `LICENSE*`), you can merge them into a +single license file in the output JAR using the [`MergeLicenseResourceTransformer`][MergeLicenseResourceTransformer]. You can configure: - `artifactLicense`: Path to the project's license file (required). -- `artifactLicenseSpdxId`: An SPDX identifier placed as a header (`SPDX-License-Identifier: `) to avoid - ambiguous license detection by scanning tools (defaults to `Apache-2.0`). +- `artifactLicenseSpdxId`: An SPDX identifier placed as a header (`SPDX-License-Identifier: `) to avoid ambiguous + license detection by scanning tools (defaults to `Apache-2.0`). - `outputPath`: The destination path in the final JAR (defaults to `META-INF/LICENSE`). - `firstSeparator`: Separator between the project's license and dependency licenses. - `separator`: Separator between individual dependency licenses. @@ -716,7 +720,8 @@ You can configure: } ``` -If you instead want to discard all license files from the output JAR, you can simply use [`ShadowJar.exclude`][ShadowJar.exclude]: +If you instead want to discard all license files from the output JAR, you can simply use +[`ShadowJar.exclude`][ShadowJar.exclude]: === "Kotlin" @@ -799,7 +804,8 @@ While standard manifest attributes can be configured using Gradle's native `mani relocating class and package names within configured manifest attributes (such as `Export-Package`, `Import-Package`, `Provide-Capability`, `Require-Capability` by default, configurable via `attributesToRelocate`): -To remove a specific attribute from the manifest, map its name to [`ManifestResourceTransformer.NULL`][ManifestResourceTransformer.NULL]. +To remove a specific attribute from the manifest, map its name to +[`ManifestResourceTransformer.NULL`][ManifestResourceTransformer.NULL]. === "Kotlin" @@ -831,14 +837,13 @@ To remove a specific attribute from the manifest, map its name to [`ManifestReso } ``` - ## Preserving First-Found Resources -[`PreserveFirstFoundResourceTransformer`][PreserveFirstFoundResourceTransformer] preserves the first resource -matching the specified patterns and discards any subsequent duplicates found with the same path. +[`PreserveFirstFoundResourceTransformer`][PreserveFirstFoundResourceTransformer] preserves the first resource matching +the specified patterns and discards any subsequent duplicates found with the same path. -This transformer is useful when `duplicatesStrategy` is set to `INCLUDE` or `WARN`, ensuring that project resources -take precedence and duplicate dependency resources at the same path are omitted. +This transformer is useful when `duplicatesStrategy` is set to `INCLUDE` or `WARN`, ensuring that project resources take +precedence and duplicate dependency resources at the same path are omitted. === "Kotlin" @@ -868,8 +873,9 @@ JARs and ensures that duplicate files with identical SHA-256 content are include If multiple files share the **same path** but have **different** content, the transformer will fail the build with a detailed report of the conflicting paths and file hashes. -If certain duplicate resources at the same path legitimately have different content (such as Maven `pom.properties` or -`pom.xml` files from different dependency versions), you can exclude those paths from being checked using `exclude(...)`: +If certain duplicate resources at the same path legitimately have different content (such as Maven `pom.properties` +or `pom.xml` files from different dependency versions), you can exclude those paths from being checked using +`exclude(...)`: !!! warning "Do Not Combine with PreserveFirstFoundResourceTransformer" @@ -899,10 +905,11 @@ If certain duplicate resources at the same path legitimately have different cont ## Finding Resources in the Classpath -When dealing with resource merge conflicts, it can be helpful to find which dependencies contain the conflicting resources. -Shadow provides a [`FindResourceInClasspath`][FindResourceInClasspath] helper task for this purpose. +When dealing with resource merge conflicts, it can be helpful to find which dependencies contain the conflicting +resources. Shadow provides a [`FindResourceInClasspath`][FindResourceInClasspath] helper task for this purpose. -To scan for resources, register a [`FindResourceInClasspath`][FindResourceInClasspath] task in your build script and configure its `classpath` and the resource patterns to look for: +To scan for resources, register a [`FindResourceInClasspath`][FindResourceInClasspath] task in your build script and +configure its `classpath` and the resource patterns to look for: === "Kotlin" @@ -929,7 +936,6 @@ You can then run the task to scan each entry on the classpath and print any matc ``` - [AbstractCopyTask]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.AbstractCopyTask.html [Jar.eachFile]: https://docs.gradle.org/current/dsl/org.gradle.jvm.tasks.Jar.html#org.gradle.jvm.tasks.Jar:eachFile(org.gradle.api.Action) [Jar.filesMatching]: https://docs.gradle.org/current/dsl/org.gradle.jvm.tasks.Jar.html#org.gradle.jvm.tasks.Jar:filesMatching(java.lang.Iterable,%20org.gradle.api.Action) diff --git a/docs/configuration/minimizing/README.md b/docs/configuration/minimizing/README.md index dbde7986c1..d06d92e8e1 100644 --- a/docs/configuration/minimizing/README.md +++ b/docs/configuration/minimizing/README.md @@ -19,10 +19,10 @@ minimizing the resulting shadowed JAR. } ``` -A dependency can be excluded from the minimization process, thereby forcing its inclusion the shadow JAR. -This is useful when the dependency analyzer cannot find the usage of a class programmatically, for example if the class -is loaded dynamically via `Class.forName(String)`. Each of the `group`, `name` and `version` fields separated by `:` of -a `dependency` is interpreted as a regular expression. +A dependency can be excluded from the minimization process, thereby forcing its inclusion the shadow JAR. This is useful +when the dependency analyzer cannot find the usage of a class programmatically, for example if the class is loaded +dynamically via `Class.forName(String)`. Each of the `group`, `name` and `version` fields separated by `:` of a +`dependency` is interpreted as a regular expression. === "Kotlin" @@ -78,12 +78,12 @@ Similar to [`ShadowJar.dependencies`][ShadowJar.dependencies], projects can also ## Minimizing with R8 -Shadow can also run [R8][R8] over the final shadowed JAR. This is useful when you want -whole-program shrinking instead of the default dependency analyzer. R8 runs after Shadow has merged, transformed, and -relocated the JAR, so service descriptors in `META-INF/services` are used to keep service providers. +Shadow can also run [R8][R8] over the final shadowed JAR. This is useful when you want whole-program shrinking instead +of the default dependency analyzer. R8 runs after Shadow has merged, transformed, and relocated the JAR, so service +descriptors in `META-INF/services` are used to keep service providers. -The default R8 configuration only shrinks unused code. It disables name minification and optimization. -R8 also applies rules published in dependency JARs, for example under `META-INF/proguard`. +The default R8 configuration only shrinks unused code. It disables name minification and optimization. R8 also applies +rules published in dependency JARs, for example under `META-INF/proguard`. === "Kotlin" @@ -180,14 +180,12 @@ Add them as `proguardRules` when you want to retain name mappings, matched keep Relative report paths are resolved from the directory containing `configurationFile`. The example above writes the reports under `build/r8/reports`. Use absolute paths if the reports must be written independently of the configuration -file location. This behavior follows -[R8's configuration parser][ProguardConfigurationParser]. -`-printmapping` only contains renamed items, so call `enableObfuscation()` when you need a useful mapping. +file location. This behavior follows [R8's configuration parser][ProguardConfigurationParser]. `-printmapping` only +contains renamed items, so call `enableObfuscation()` when you need a useful mapping. These reporting options belong in the build's R8 configuration, not in rules published inside a dependency JAR. -Android's -[library optimization guidance][library-optimization-guidance] -lists them among the global options that library authors should not publish as consumer keep rules. +Android's [library optimization guidance][library-optimization-guidance] lists them among the global options that +library authors should not publish as consumer keep rules. Shadow resolves R8 from the `shadowR8` configuration. The default dependency is `com.android.tools:r8`, which is published by Google Maven rather than Maven Central. Add `google()` to your repositories or override the dependency: @@ -208,9 +206,9 @@ published by Google Maven rather than Maven Central. Add `google()` to your repo } ``` -Advanced R8 command line arguments can be added with `args`. Replacing the default `args` value removes Shadow's -default command line arguments, so prefer the helper functions for common obfuscation and optimization toggles. These -helpers are independent and can be used together. +Advanced R8 command line arguments can be added with `args`. Replacing the default `args` value removes Shadow's default +command line arguments, so prefer the helper functions for common obfuscation and optimization toggles. These helpers +are independent and can be used together. For example, to downgrade R8 warnings to info: @@ -351,7 +349,6 @@ To enable both: ``` - [-printmapping]: https://www.guardsquare.com/manual/configuration/usage#printmapping [-printseeds]: https://www.guardsquare.com/manual/configuration/usage#printseeds [-printusage]: https://www.guardsquare.com/manual/configuration/usage#printusage diff --git a/docs/configuration/relocation/README.md b/docs/configuration/relocation/README.md index 1d79b83f60..dc7dd714d2 100644 --- a/docs/configuration/relocation/README.md +++ b/docs/configuration/relocation/README.md @@ -1,15 +1,14 @@ # Relocating Packages -Shadow is capable of scanning a project's classes and relocating specific dependencies to a new location. -This is often required when one of the dependencies is susceptible to breaking changes in versions or -to classpath pollution in a downstream project. +Shadow is capable of scanning a project's classes and relocating specific dependencies to a new location. This is often +required when one of the dependencies is susceptible to breaking changes in versions or to classpath pollution in a +downstream project. !!! tip Google's Guava and the ASM library are typical cases where package relocation can come in handy. -Shadow uses the ASM library to modify class byte code to replace the package name and any import -statements for a class. +Shadow uses the ASM library to modify class byte code to replace the package name and any import statements for a class. Any non-class files that are stored within a package structure are also relocated to the new location. === "Kotlin" @@ -28,10 +27,9 @@ Any non-class files that are stored within a package structure are also relocate } ``` -The code snippet will rewrite the location for any class in the `junit.framework` to be `shadow.junit`. -For example, the class `junit.framework.TestCase` becomes `shadow.junit.TestCase`. -In the resulting JAR, the class file is relocated from `junit/framework/TestCase.class` to -`shadow/junit/TestCase.class`. +The code snippet will rewrite the location for any class in the `junit.framework` to be `shadow.junit`. For example, the +class `junit.framework.TestCase` becomes `shadow.junit.TestCase`. In the resulting JAR, the class file is relocated +from `junit/framework/TestCase.class` to `shadow/junit/TestCase.class`. !!! warning "Scope of Relocation" @@ -210,12 +208,12 @@ To configure automatic dependency relocation, set `enableAutoRelocation = true` !!! warning "Performance & Transitive Dependencies" - Configuring package auto relocation can add significant time to the shadow process as it will process all dependencies - in the configurations declared to be shadowed. By default, this is the `runtime` or `runtimeClasspath` configurations. - - Be mindful that some Gradle plugins will automatically add dependencies to your class path. You may need to remove these - dependencies if you do not intend to shadow them into your library. + Configuring package auto relocation can add significant time to the shadow process as it will process all + dependencies in the configurations declared to be shadowed. By default, this is the `runtime` or `runtimeClasspath` + configurations. + Be mindful that some Gradle plugins will automatically add dependencies to your class path. You may need to remove + these dependencies if you do not intend to shadow them into your library. ## Relocating Kotlin Standard Library @@ -253,11 +251,11 @@ This is useful in some cases, as mentioned in [#759]. See ## Relocating with R8 -As an alternative to Shadow's built-in `relocate` configuration (which uses ASM to rename package prefixes during -JAR merging), you can use [R8][r8-minimizing] to handle package relocation (also referred to as *repackaging*). +As an alternative to Shadow's built-in `relocate` configuration (which uses ASM to rename package prefixes during JAR +merging), you can use [R8][r8-minimizing] to handle package relocation (also referred to as *repackaging*). -R8 performs whole-program analysis during its minimization pass to safely relocate classes while respecting Java -access visibility constraints (such as package-private and `protected` members). For more details on R8 rules, see +R8 performs whole-program analysis during its minimization pass to safely relocate classes while respecting Java access +visibility constraints (such as package-private and `protected` members). For more details on R8 rules, see the [Global options for additional optimization][android-r8-global-options] and ProGuard manual for [-repackageclasses][repackageclasses], [-allowaccessmodification][allowaccessmodification] and [-keeppackagenames][keeppackagenames]. @@ -315,13 +313,12 @@ To use R8 for package relocation, enable R8 under `minimize` and provide ProGuar ### Comparison: Shadow `relocate` vs. R8 Repackaging -| Feature | Shadow `relocate` (`SimpleRelocator`) | R8 Repackaging (`-repackageclasses`) | -|:----------------------------|:--------------------------------------------------|:----------------------------------------------------| -| **Execution Stage** | During JAR merging (ASM bytecode transformation) | Post-merge whole-program optimization | -| **Relocation Scope** | Explicit per-prefix or per-class pattern matching | Whole-program automatic relocation | -| **Visibility Handling** | Direct string/type renaming (no visibility check) | Analyzes package-private & protected constraints | -| **Shrinking / Obfuscation** | Relocation only | Combined with shrinking (optional name obfuscation) | - +| Feature | Shadow `relocate` (`SimpleRelocator`) | R8 Repackaging (`-repackageclasses`) | +|:---|:---|:---| +| **Execution Stage** | During JAR merging (ASM bytecode transformation) | Post-merge whole-program optimization | +| **Relocation Scope** | Explicit per-prefix or per-class pattern matching | Whole-program automatic relocation | +| **Visibility Handling** | Direct string/type renaming (no visibility check) | Analyzes package-private & protected constraints | +| **Shrinking / Obfuscation** | Relocation only | Combined with shrinking (optional name obfuscation) | [#1622]: https://github.com/GradleUp/shadow/issues/1622 diff --git a/docs/configuration/reproducible-builds/README.md b/docs/configuration/reproducible-builds/README.md index 2e022f3da4..2dad034709 100644 --- a/docs/configuration/reproducible-builds/README.md +++ b/docs/configuration/reproducible-builds/README.md @@ -59,6 +59,5 @@ within the JAR, then this may not be the correct choice for you. See the [Reproducible archives section in Gradle's documentation][reproducible-archives-section] for more information. - [reproducible-builds.org]: https://reproducible-builds.org/ [reproducible-archives-section]: https://docs.gradle.org/4.9/userguide/working_with_files.html#sec:reproducible_archives diff --git a/docs/custom-tasks/README.md b/docs/custom-tasks/README.md index 2b77b21c4f..59bf742bf8 100644 --- a/docs/custom-tasks/README.md +++ b/docs/custom-tasks/README.md @@ -1,9 +1,9 @@ # Creating a Custom ShadowJar Task -The built in [`ShadowJar`][ShadowJar] task only provides an output for the `main` source set of the project. -It is possible to add arbitrary [`ShadowJar`][ShadowJar] tasks to a project. When doing so, ensure that the -[`configurations`][ShadowJar.configurations] property is specified to inform Shadow which dependencies to merge into -the output. +The built in [`ShadowJar`][ShadowJar] task only provides an output for the `main` source set of the project. It is +possible to add arbitrary [`ShadowJar`][ShadowJar] tasks to a project. When doing so, ensure that the +[`configurations`][ShadowJar.configurations] property is specified to inform Shadow which dependencies to merge into the +output. === "Kotlin" @@ -57,8 +57,8 @@ The code snippet above will generate a shadowed JAR containing both the `main` a ## Creating a Dependencies-Only Shadow JAR -It is also possible to create a shadow JAR that contains *only* the dependencies and none of the project's own -source code. This is accomplished by creating a custom [`ShadowJar`][ShadowJar] task and configuring the +It is also possible to create a shadow JAR that contains *only* the dependencies and none of the project's own source +code. This is accomplished by creating a custom [`ShadowJar`][ShadowJar] task and configuring the [`configurations`][ShadowJar.configurations] property, but **not** adding any project sources with `from(...)`. === "Kotlin" @@ -85,7 +85,6 @@ The above configuration will create a shadow JAR file that contains only the cla configuration. The standard `jar` task will still produce a JAR with only the project's sources. - [Jar]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html [ShadowJar.configurations]: ../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/configurations.html [ShadowJar]: ../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html diff --git a/docs/getting-started/README.md b/docs/getting-started/README.md index 9572dc9ef6..5cf39cb030 100644 --- a/docs/getting-started/README.md +++ b/docs/getting-started/README.md @@ -111,11 +111,9 @@ Alternatively, the plugin can be added to the buildscript classpath and applied: The correct maven coordinates for each version of Shadow can be found by referencing the Gradle Plugin documentation [here][gradle-plugin-portal]. -Shadow is a reactive plugin. -This means that applying Shadow by itself will perform no configuration on your project. +Shadow is a reactive plugin. This means that applying Shadow by itself will perform no configuration on your project. Instead, Shadow _reacts_ -This means, that for most users, the `java` or `groovy` plugins must be _explicitly_ applied -to have the desired effect. +This means, that for most users, the `java` or `groovy` plugins must be _explicitly_ applied to have the desired effect. ## Default Java/Kotlin/Groovy Tasks @@ -145,8 +143,8 @@ in their build logic), Shadow will automatically configure the following behavio ## ShadowJar Command Line options -Sometimes, a user wants to declare the value of an exposed task property on the command line instead of the -build script. Passing property values on the command line is particularly helpful if they change more frequently. +Sometimes, a user wants to declare the value of an exposed task property on the command line instead of the build +script. Passing property values on the command line is particularly helpful if they change more frequently. Here are the options that can be passed to the `shadowJar`: ``` @@ -174,7 +172,6 @@ Also, you can view more information about the [`ShadowJar`][ShadowJar] task by r Refer to [listing command line options][listing-command-line-options]. - [Jar]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html [JavaPlugin]: https://docs.gradle.org/current/userguide/java_plugin.html [maven-publish]: https://docs.gradle.org/current/userguide/publishing_maven.html diff --git a/docs/images/logo.orig.svg b/docs/images/logo.orig.svg index b5ed5c6d25..1079d031ef 100644 --- a/docs/images/logo.orig.svg +++ b/docs/images/logo.orig.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/docs/kotlin-plugins/README.md b/docs/kotlin-plugins/README.md index 2571a92338..c03bbfd0f5 100644 --- a/docs/kotlin-plugins/README.md +++ b/docs/kotlin-plugins/README.md @@ -1,8 +1,8 @@ # Integrating with Kotlin Plugins Kotlin standard libraries (stdlib) are added by Kotlin plugins by default via `implementation` (`runtimeClasspath`), -they will be bundled into the shadowed JARs automatically. -If you don't need a standard library at all, you can add the following Gradle property to your gradle.properties file: +they will be bundled into the shadowed JARs automatically. If you don't need a standard library at all, you can add the +following Gradle property to your gradle.properties file: ```properties kotlin.stdlib.default.dependency=false @@ -59,9 +59,9 @@ Shadow works well for Kotlin JVM projects like Java projects. Here is an example } ``` -You can mix the Kotlin JVM plugin with `java-gradle-plugin`, `application`, and other Java plugins, -easily organize your build logic for [Publishing Libraries][publishing-libraries], -[Running Applications][running-applications], and so on. +You can mix the Kotlin JVM plugin with `java-gradle-plugin`, `application`, and other Java plugins, easily organize +your build logic for [Publishing Libraries][publishing-libraries], [Running Applications][running-applications], +and so on. ## For Kotlin Multiplatform Plugin @@ -166,7 +166,6 @@ To explicitly apply this remapping (recommended for future compatibility), add ``` - [org.jetbrains.kotlin.multiplatform]: https://kotlinlang.org/docs/multiplatform-intro.html [KotlinModuleMetadataTransformer]: ../api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-kotlin-module-metadata-transformer/index.html [dependency-on-the-standard-library]: https://kotlinlang.org/docs/gradle-configure-project.html#dependency-on-the-standard-library diff --git a/docs/multi-project/README.md b/docs/multi-project/README.md index 3b8c11994e..8b51f00162 100644 --- a/docs/multi-project/README.md +++ b/docs/multi-project/README.md @@ -1,15 +1,13 @@ # Using Shadow in Multi-Project Builds -When using Shadow in a multi-project build, project dependencies will be treated the same as -external dependencies. -That is a project dependency will be merged into the [`ShadowJar`][ShadowJar] output of the project that -is applying the Shadow plugin. +When using Shadow in a multi-project build, project dependencies will be treated the same as external dependencies. That +is a project dependency will be merged into the [`ShadowJar`][ShadowJar] output of the project that is applying the +Shadow plugin. ## Depending on the Shadow Jar from Another Project -In a multi-project build there may be one project that applies Shadow and another that -requires the shadowed JAR as a dependency. -In this case, use Gradle's normal dependency declaration mechanism to depend on the `shadow` +In a multi-project build there may be one project that applies Shadow and another that requires the shadowed JAR as a +dependency. In this case, use Gradle's normal dependency declaration mechanism to depend on the `shadow` configuration of the shadowed project. === "Kotlin" @@ -88,7 +86,8 @@ the shadowed JAR by default, preventing accidental consumption of the unshadowed !!! important - Clearing `outgoing.variants` ensures Gradle doesn't select the unshadowed `classes` variant by default during compilation. + Clearing `outgoing.variants` ensures Gradle doesn't select the unshadowed `classes` variant by default during + compilation. **Consuming projects can then depend on `:api` without specifying the `shadow` configuration:** @@ -152,6 +151,5 @@ configurations as well: ``` - [Jar]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html [ShadowJar]: ../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html diff --git a/docs/publishing/README.md b/docs/publishing/README.md index e5653e3033..3ff4373caf 100644 --- a/docs/publishing/README.md +++ b/docs/publishing/README.md @@ -3,9 +3,8 @@ ## Publishing with Maven-Publish Plugin The Shadow plugin will automatically configure the necessary tasks in the presence of Gradle's -[`maven-publish`][maven-publish] plugin. -The plugin provides the `shadow` component to configure the publication with the necessary -artifact and dependencies in the POM file. +[`maven-publish`][maven-publish] plugin. The plugin provides the `shadow` component to configure the publication with +the necessary artifact and dependencies in the POM file. === "Kotlin" @@ -127,9 +126,9 @@ you can disable this by setting the `addTargetJvmVersionAttribute` property in t } ``` -The BUNDLING attribute (`org.gradle.dependency.bundling`) of the shadowed variant is set to `shadowed` by default, -it is useful for consumers to distinguish between normal and shadowed dependencies. You can override this attribute by -setting the `bundlingAttribute` property in the `shadow` extension: +The BUNDLING attribute (`org.gradle.dependency.bundling`) of the shadowed variant is set to `shadowed` by default, it is +useful for consumers to distinguish between normal and shadowed dependencies. You can override this attribute by setting +the `bundlingAttribute` property in the `shadow` extension: === "Kotlin" @@ -151,22 +150,16 @@ setting the `bundlingAttribute` property in the `shadow` extension: ## Shadow Configuration and Publishing -The Shadow plugin provides a custom configuration (`configurations.shadow`) to specify -runtime dependencies that are **not** merged into the final JAR file. -When configuring publishing with the Shadow plugin, the dependencies in the `shadow` -configuration, are translated to become `RUNTIME` scoped dependencies of the -published artifact. +The Shadow plugin provides a custom configuration (`configurations.shadow`) to specify runtime dependencies that are +**not** merged into the final JAR file. When configuring publishing with the Shadow plugin, the dependencies in the +`shadow` configuration, are translated to become `RUNTIME` scoped dependencies of the published artifact. -No other dependencies are automatically configured for inclusion in the POM file. -For example, excluded dependencies are **not** automatically added to the POM file or -if the configuration for merging are modified by specifying -`shadowJar.configurations = [configurations.myConfiguration]`, there is no automatic -configuration of the POM file. - -This automatic configuration occurs _only_ when using the above methods for -configuring publishing. If this behavior is not desirable, then publishing **must** -be manually configured. +No other dependencies are automatically configured for inclusion in the POM file. For example, excluded dependencies are +**not** automatically added to the POM file or if the configuration for merging are modified by specifying +`shadowJar.configurations = [configurations.myConfiguration]`, there is no automatic configuration of the POM file. +This automatic configuration occurs _only_ when using the above methods for configuring publishing. If this behavior is +not desirable, then publishing **must** be manually configured. === "Kotlin" @@ -252,8 +245,8 @@ be manually configured. ## Publishing the Shadowed JAR instead of the Original JAR -You may want to publish the shadowed JAR instead of the original JAR. This can be done by trimming -the `archiveClassifier` of the shadowed JAR like the following: +You may want to publish the shadowed JAR instead of the original JAR. This can be done by trimming the +`archiveClassifier` of the shadowed JAR like the following: === "Kotlin" @@ -302,8 +295,8 @@ the `archiveClassifier` of the shadowed JAR like the following: ``` Because the default `archiveClassifier` of [`Jar`][Jar] is `""` (empty), setting the `archiveClassifier` of -[`ShadowJar`][ShadowJar] to `""` (empty) will make collisions between the outputs of these two tasks in some cases. -If you don't need the standard JAR, you can disable the `jar` task like: +[`ShadowJar`][ShadowJar] to `""` (empty) will make collisions between the outputs of these two tasks in some cases. If +you don't need the standard JAR, you can disable the `jar` task like: === "Kotlin" @@ -341,11 +334,11 @@ Or set a different `archiveClassifier` for the standard [`Jar`][Jar] like: ## Publishing the Shadowed Gradle Plugins -The Gradle Publish Plugin introduced support for plugins packaged with Shadow in version 1.0.0. -Starting with this version, plugin projects that apply both Shadow and the Gradle Plugin Publish plugin will be -automatically configured to publish the output of the [`ShadowJar`][ShadowJar] tasks as the consumable artifact for the -plugin. See the [Gradle Plugin Publish docs][gradle-plugin-publish-docs] for details. -The only thing you need to do from the Shadow side is to empty the `archiveClassifier` like: +The Gradle Publish Plugin introduced support for plugins packaged with Shadow in version 1.0.0. Starting with this +version, plugin projects that apply both Shadow and the Gradle Plugin Publish plugin will be automatically configured to +publish the output of the [`ShadowJar`][ShadowJar] tasks as the consumable artifact for the plugin. See +the [Gradle Plugin Publish docs][gradle-plugin-publish-docs] for details. The only thing you need to do from the Shadow +side is to empty the `archiveClassifier` like: === "Kotlin" @@ -523,7 +516,6 @@ We modified `archiveClassifier`, `archiveExtension` and `archiveBaseName` in thi be named `my-artifact-2.0-my-classifier.my-ext` instead of `1.0-all.jar`. - [Jar]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html [MavenPublication.artifact]: https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html#org.gradle.api.publish.maven.MavenPublication:artifact(java.lang.Object) [ShadowJar]: ../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html From fc22f90e71422636fc7deb2e8db9c455c60ab15d Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 24 Aug 2026 13:44:59 +0800 Subject: [PATCH 02/11] Support 2-space nested list indentation in MkDocs --- .github/workflows/deploy.yml | 2 +- .github/workflows/links.yml | 2 +- CONTRIBUTING.md | 2 +- mkdocs.yml | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 737eec013b..f8926a89fd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -23,7 +23,7 @@ jobs: - name: Build Site run: | # Don't cache it to track updates. - pip install mkdocs-material + pip install mkdocs-material mdx_truly_sane_lists mkdocs build - uses: actions/upload-pages-artifact@v5 with: diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index aeff00ae1b..4c9e98a9aa 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -31,7 +31,7 @@ jobs: - name: Mkdocs build validation run: | # Don't cache it to track updates. - pip install mkdocs-material + pip install mkdocs-material mdx_truly_sane_lists mkdocs build --strict - uses: umbrelladocs/action-linkspector@v1 with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ee88ff5465..94d8cb962b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,7 +60,7 @@ Shadow uses [Android Lint](https://developer.android.com/studio/write/lint) to c Shadow's user guide is built using [MkDocs Material](https://squidfunk.github.io/mkdocs-material/). You can build and preview the documentation website locally: -- **Install MkDocs dependencies**: `pip install mkdocs mkdocs-material` +- **Install MkDocs dependencies**: `pip install mkdocs-material mdx_truly_sane_lists` - **Preview documentation locally**: `mkdocs serve` (then navigate to `http://127.0.0.1:8000/`) - **Build the static site**: `mkdocs build` diff --git a/mkdocs.yml b/mkdocs.yml index e3dadfe12f..1df8f0cfab 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,4 @@ -# pip install mkdocs mkdocs-material +# pip install mkdocs-material mdx_truly_sane_lists # mkdocs serve # mkdocs gh-deploy @@ -63,6 +63,9 @@ markdown_extensions: - admonition - attr_list - md_in_html + - mdx_truly_sane_lists: + nested_indent: 2 + truly_sane: true nav: - 'Introduction': README.md From c6521243e4899e4cb25c88fb93406867c68b8648 Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 24 Aug 2026 13:50:55 +0800 Subject: [PATCH 03/11] Use 2-space indentation for nested lists across documentation --- docs/changes/README.md | 30 ++++++++++++++-------------- docs/configuration/merging/README.md | 12 +++++------ docs/getting-started/README.md | 16 +++++++-------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/docs/changes/README.md b/docs/changes/README.md index 103bbc0eb7..7fe8ea26ba 100644 --- a/docs/changes/README.md +++ b/docs/changes/README.md @@ -354,10 +354,10 @@ - Improve the error message for empty `mainClassName`. ([#1601](https://github.com/GradleUp/shadow/pull/1601)) - Default `duplicatesStrategy` back to `EXCLUDE`. ([#1617](https://github.com/GradleUp/shadow/pull/1617)) - - This strategy is consistent with 8.x series behavior, which is more compatible for most users upgrading. - - For most `ResourceTransformer` users, you need to override the strategy to `INCLUDE` to make them work. - - Strongly suggest declaring the `duplicatesStrategy` explicitly in your `ShadowJar` configuration to avoid confusion. - - See more details about the strategies at [Handling Duplicates Strategy](https://gradleup.com/shadow/configuration/merging/#handling-duplicates-strategy). + - This strategy is consistent with 8.x series behavior, which is more compatible for most users upgrading. + - For most `ResourceTransformer` users, you need to override the strategy to `INCLUDE` to make them work. + - Strongly suggest declaring the `duplicatesStrategy` explicitly in your `ShadowJar` configuration to avoid confusion. + - See more details about the strategies at [Handling Duplicates Strategy](https://gradleup.com/shadow/configuration/merging/#handling-duplicates-strategy). ### Fixed @@ -419,9 +419,9 @@ - Fail build if the ZIP entries in the shadowed JAR are duplicate. ([#1552](https://github.com/GradleUp/shadow/pull/1552)) This feature is controlled by the `shadowJar.failOnDuplicateEntries` property, which is `false` by default. Related to setting `duplicatesStrategy = DuplicatesStrategy.FAIL` but there are some differences: - - It only checks the entries in the shadowed jar, not the input files. - - It works with setting `duplicatesStrategy` to any value. - - It provides a stricter fallback check before the JAR is created. + - It only checks the entries in the shadowed jar, not the input files. + - It works with setting `duplicatesStrategy` to any value. + - It provides a stricter fallback check before the JAR is created. ### Changed @@ -438,14 +438,14 @@ - **BREAKING CHANGE:** Move tracking unused classes logic out of `ShadowCopyAction`. ([#1257](https://github.com/GradleUp/shadow/pull/1257)) - **BREAKING CHANGE:** Move `DependencyFilter` into `tasks` package. ([#1272](https://github.com/GradleUp/shadow/pull/1272)) - **BREAKING CHANGE:** Change the default `duplicatesStrategy` from `EXCLUDE` to `INCLUDE`. ([#1233](https://github.com/GradleUp/shadow/pull/1233)) - - `ShadowJar` recognized `EXCLUDE` as the default, but the other strategies didn't work properly. - - Now `ShadowJar` honors `INCLUDE` as the default, and aligns all the strategy behaviors with the Gradle side. - - Some `ResourceTransformer`s (e.g. `ServiceFileTransformer`) do not work with `EXCLUDE`, as it will exclude duplicate resources to be merged. - - Duplicate entries might be bundled due to this change, but you can reduce them by using the newly added `PreserveFirstFoundResourceTransformer`. - - Use `filesMatching` to override the default strategy for specific files. - - Set `failOnDuplicateEntries = true` to fail the build to check for duplicate entries. - - See more details at [Handling Duplicates Strategy](https://gradleup.com/shadow/configuration/merging/#handling-duplicates-strategy). - - **Note:** The default `duplicatesStrategy` is changed back to `EXCLUDE` in 9.0.1 release. + - `ShadowJar` recognized `EXCLUDE` as the default, but the other strategies didn't work properly. + - Now `ShadowJar` honors `INCLUDE` as the default, and aligns all the strategy behaviors with the Gradle side. + - Some `ResourceTransformer`s (e.g. `ServiceFileTransformer`) do not work with `EXCLUDE`, as it will exclude duplicate resources to be merged. + - Duplicate entries might be bundled due to this change, but you can reduce them by using the newly added `PreserveFirstFoundResourceTransformer`. + - Use `filesMatching` to override the default strategy for specific files. + - Set `failOnDuplicateEntries = true` to fail the build to check for duplicate entries. + - See more details at [Handling Duplicates Strategy](https://gradleup.com/shadow/configuration/merging/#handling-duplicates-strategy). + - **Note:** The default `duplicatesStrategy` is changed back to `EXCLUDE` in 9.0.1 release. - **BREAKING CHANGE:** Align the behavior of `ShadowTask.from` with Gradle's `AbstractCopyTask.from`. ([#1233](https://github.com/GradleUp/shadow/pull/1233)) In the previous versions, `ShadowTask.from` would always unzip the files before processing them, which caused serial issues that are hard to fix. Now it behaves like Gradle's `AbstractCopyTask.from`, which means it will not unzip diff --git a/docs/configuration/merging/README.md b/docs/configuration/merging/README.md index e82de77874..289d9d75f5 100644 --- a/docs/configuration/merging/README.md +++ b/docs/configuration/merging/README.md @@ -105,12 +105,12 @@ steps to take: 1. Set the default strategy to `INCLUDE` or `WARN`. 2. Apply your [`ResourceTransformer`][ResourceTransformer]s. 3. Remove duplicate entries by - - overriding the default strategy for specific files to `EXCLUDE` or `FAIL` using - [`filesMatching`][Jar.filesMatching], [`filesNotMatching`][Jar.filesNotMatching], or [`eachFile`][Jar.eachFile] - functions - - or applying [`PreserveFirstFoundResourceTransformer`][PreserveFirstFoundResourceTransformer] for specific files - - or write your own [`ResourceTransformer`][ResourceTransformer] to handle duplicates - - or mechanism similar. + - overriding the default strategy for specific files to `EXCLUDE` or `FAIL` using + [`filesMatching`][Jar.filesMatching], [`filesNotMatching`][Jar.filesNotMatching], or [`eachFile`][Jar.eachFile] + functions + - or applying [`PreserveFirstFoundResourceTransformer`][PreserveFirstFoundResourceTransformer] for specific files + - or write your own [`ResourceTransformer`][ResourceTransformer] to handle duplicates + - or mechanism similar. Alternatively, you can follow these steps: diff --git a/docs/getting-started/README.md b/docs/getting-started/README.md index 5cf39cb030..7c25e469ba 100644 --- a/docs/getting-started/README.md +++ b/docs/getting-started/README.md @@ -128,16 +128,16 @@ in their build logic), Shadow will automatically configure the following behavio * Configures the [`ShadowJar`][ShadowJar] task to bundle all dependencies from the `runtimeClasspath` configuration. * Configures the _classifier_ attribute of the [`ShadowJar`][ShadowJar] task to be `'all'` . * Configures the [`ShadowJar`][ShadowJar] task to generate a `Manifest` with: - * Inheriting all configuration from the standard [`Jar`][Jar] task. - * Adds a `Class-Path` attribute to the `Manifest` that appends all dependencies from the `shadow` configuration + * Inheriting all configuration from the standard [`Jar`][Jar] task. + * Adds a `Class-Path` attribute to the `Manifest` that appends all dependencies from the `shadow` configuration * Configures the [`ShadowJar`][ShadowJar] task to _exclude_ any JAR index or cryptographic signature files matching the following patterns: - * `META-INF/INDEX.LIST` - * `META-INF/*.SF` - * `META-INF/*.DSA` - * `META-INF/*.RSA` - * `META-INF/versions/**/module-info.class` - * `module-info.class` + * `META-INF/INDEX.LIST` + * `META-INF/*.SF` + * `META-INF/*.DSA` + * `META-INF/*.RSA` + * `META-INF/versions/**/module-info.class` + * `module-info.class` * Creates and registers the `shadow` component in the project (used for integrating with [`maven-publish`][maven-publish]). From 5e032b172a7f0491d8d875271dc9b76445a50349 Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 24 Aug 2026 13:52:26 +0800 Subject: [PATCH 04/11] Unify unordered list markers to dash across documentation --- docs/about/README.md | 4 +- docs/changes/README.md | 82 +++++++++++++++++----------------- docs/getting-started/README.md | 36 +++++++-------- 3 files changed, 61 insertions(+), 61 deletions(-) diff --git a/docs/about/README.md b/docs/about/README.md index e383a687cf..58a3b70a5d 100644 --- a/docs/about/README.md +++ b/docs/about/README.md @@ -14,8 +14,8 @@ the [Gradle Plugin Portal][gradle-plugin-portal] and so Shadow was published the ## Maintainers -* [John Engelman][john-engelman] -* [Zongle Wang][zongle-wang] +- [John Engelman][john-engelman] +- [Zongle Wang][zongle-wang] ## Contributors diff --git a/docs/changes/README.md b/docs/changes/README.md index 7fe8ea26ba..09f7c86dd4 100644 --- a/docs/changes/README.md +++ b/docs/changes/README.md @@ -706,28 +706,28 @@ See more details about the fixed `DuplicatesStrategy` behaviors at [Handling Dup ### What's Changed -* Replace deprecated ConfigureUtil by [@Goooler](https://github.com/Goooler) +- Replace deprecated ConfigureUtil by [@Goooler](https://github.com/Goooler) in [#826](https://github.com/GradleUp/shadow/pull/826) -* Polish outdated configs by [@Goooler](https://github.com/Goooler) +- Polish outdated configs by [@Goooler](https://github.com/Goooler) in [#831](https://github.com/GradleUp/shadow/pull/831) -* Update plugin com.gradle.enterprise to v3.12.5 by [@renovate](https://github.com/renovate-bot) +- Update plugin com.gradle.enterprise to v3.12.5 by [@renovate](https://github.com/renovate-bot) in [#838](https://github.com/GradleUp/shadow/pull/838) -* Update dependency gradle to v8.0.2 by [@renovate](https://github.com/renovate-bot) +- Update dependency gradle to v8.0.2 by [@renovate](https://github.com/renovate-bot) in [#844](https://github.com/GradleUp/shadow/pull/844) -* fix(deps): update dependency org.codehaus.plexus:plexus-utils to v3.5.1 +- fix(deps): update dependency org.codehaus.plexus:plexus-utils to v3.5.1 by [@renovate](https://github.com/renovate-bot) in [#837](https://github.com/GradleUp/shadow/pull/837) -* chore(deps): update dependency prismjs to v1.27.0 [security] by [@renovate](https://github.com/renovate-bot) +- chore(deps): update dependency prismjs to v1.27.0 [security] by [@renovate](https://github.com/renovate-bot) in [#828](https://github.com/GradleUp/shadow/pull/828) -* Encode transformed properties files with specified Charset by [@scottsteen](https://github.com/scottsteen) +- Encode transformed properties files with specified Charset by [@scottsteen](https://github.com/scottsteen) in [#819](https://github.com/GradleUp/shadow/pull/819) -* chore(deps): update dependency vuepress to v1.9.9 by [@renovate](https://github.com/renovate-bot) +- chore(deps): update dependency vuepress to v1.9.9 by [@renovate](https://github.com/renovate-bot) in [#842](https://github.com/GradleUp/shadow/pull/842) ### New Contributors -* [@renovate](https://github.com/renovate-bot) made their first contribution +- [@renovate](https://github.com/renovate-bot) made their first contribution in [#838](https://github.com/GradleUp/shadow/pull/838) -* [@scottsteen](https://github.com/scottsteen) made their first contribution +- [@scottsteen](https://github.com/scottsteen) made their first contribution in [#819](https://github.com/GradleUp/shadow/pull/819) **Full Changelog**: [`8.1.0...8.1.1`](https://github.com/GradleUp/shadow/compare/8.1.0...8.1.1) @@ -747,14 +747,14 @@ type. ### What's Changed -* Minor cleanups by [@Goooler](https://github.com/Goooler) in [#823](https://github.com/GradleUp/shadow/pull/823) -* Support config cache by [@Goooler](https://github.com/Goooler) in [#824](https://github.com/GradleUp/shadow/pull/824) -* Fix RelocatorRemapper: do not map inner class name if not changed by [@Him188](https://github.com/Him188) +- Minor cleanups by [@Goooler](https://github.com/Goooler) in [#823](https://github.com/GradleUp/shadow/pull/823) +- Support config cache by [@Goooler](https://github.com/Goooler) in [#824](https://github.com/GradleUp/shadow/pull/824) +- Fix RelocatorRemapper: do not map inner class name if not changed by [@Him188](https://github.com/Him188) in [#793](https://github.com/GradleUp/shadow/pull/793) ### New Contributors -* [@Him188](https://github.com/Him188) made their first contribution +- [@Him188](https://github.com/Him188) made their first contribution in [#793](https://github.com/GradleUp/shadow/pull/793) **Full Changelog**: [`8.0.0...8.1.0`](https://github.com/GradleUp/shadow/compare/8.0.0...8.1.0) @@ -763,61 +763,61 @@ type. ### What's Changed -* Fix the plugin dependency identifier in the docs by [@lnhrdt](https://github.com/lnhrdt) +- Fix the plugin dependency identifier in the docs by [@lnhrdt](https://github.com/lnhrdt) in [#754](https://github.com/GradleUp/shadow/pull/754) -* mergeGroovyExtensionModules() not working with Groovy 2.5+ by [@paulk-asert](https://github.com/paulk-asert) +- mergeGroovyExtensionModules() not working with Groovy 2.5+ by [@paulk-asert](https://github.com/paulk-asert) in [#779](https://github.com/GradleUp/shadow/pull/779) -* Upgrade to ASM 9.3 to support JDK 19. by [@vyazelenko](https://github.com/vyazelenko) +- Upgrade to ASM 9.3 to support JDK 19. by [@vyazelenko](https://github.com/vyazelenko) in [#770](https://github.com/GradleUp/shadow/pull/770) -* Do not add a dependencies block if it's already there by [@desiderantes](https://github.com/desiderantes) +- Do not add a dependencies block if it's already there by [@desiderantes](https://github.com/desiderantes) in [#769](https://github.com/GradleUp/shadow/pull/769) -* Update README with new badge and links by [@ThexXTURBOXx](https://github.com/ThexXTURBOXx) +- Update README with new badge and links by [@ThexXTURBOXx](https://github.com/ThexXTURBOXx) in [#743](https://github.com/GradleUp/shadow/pull/743) -* Fix value not set when rawString is true. by [@qian0817](https://github.com/qian0817) +- Fix value not set when rawString is true. by [@qian0817](https://github.com/qian0817) in [#765](https://github.com/GradleUp/shadow/pull/765) -* Mark the Log4j2PluginsCacheFileTransformer as cacheable. by [@staktrace](https://github.com/staktrace) +- Mark the Log4j2PluginsCacheFileTransformer as cacheable. by [@staktrace](https://github.com/staktrace) in [#724](https://github.com/GradleUp/shadow/pull/724) -* Fix retrieval of dependencies node when publishing by [@netomi](https://github.com/netomi) +- Fix retrieval of dependencies node when publishing by [@netomi](https://github.com/netomi) in [#798](https://github.com/GradleUp/shadow/pull/798) -* Upgrade dependency ASM from `9.3` to `9.4` by [@codecholeric](https://github.com/codecholeric) +- Upgrade dependency ASM from `9.3` to `9.4` by [@codecholeric](https://github.com/codecholeric) in [#817](https://github.com/GradleUp/shadow/pull/817) -* Fix a typo of code comment in the minimizing page by [@jebnix](https://github.com/jebnix) +- Fix a typo of code comment in the minimizing page by [@jebnix](https://github.com/jebnix) in [#800](https://github.com/GradleUp/shadow/pull/800) -* Prefer using plugin extensions over deprecated conventions by [@eskatos](https://github.com/eskatos) +- Prefer using plugin extensions over deprecated conventions by [@eskatos](https://github.com/eskatos) in [#821](https://github.com/GradleUp/shadow/pull/821) -* Introduce CleanProperties by [@simPod](https://github.com/simPod) +- Introduce CleanProperties by [@simPod](https://github.com/simPod) in [#622](https://github.com/GradleUp/shadow/pull/622) -* Support Gradle 8.0 by [@Goooler](https://github.com/Goooler) in [#822](https://github.com/GradleUp/shadow/pull/822) -* Updated dependencies, Gradle versions and Fix Test by [@ElisaMin](https://github.com/ElisaMin) +- Support Gradle 8.0 by [@Goooler](https://github.com/Goooler) in [#822](https://github.com/GradleUp/shadow/pull/822) +- Updated dependencies, Gradle versions and Fix Test by [@ElisaMin](https://github.com/ElisaMin) in [#791](https://github.com/GradleUp/shadow/pull/791) ### New Contributors -* [@lnhrdt](https://github.com/lnhrdt) made their first contribution +- [@lnhrdt](https://github.com/lnhrdt) made their first contribution in [#754](https://github.com/GradleUp/shadow/pull/754) -* [@paulk-asert](https://github.com/paulk-asert) made their first contribution +- [@paulk-asert](https://github.com/paulk-asert) made their first contribution in [#779](https://github.com/GradleUp/shadow/pull/779) -* [@desiderantes](https://github.com/desiderantes) made their first contribution +- [@desiderantes](https://github.com/desiderantes) made their first contribution in [#769](https://github.com/GradleUp/shadow/pull/769) -* [@ThexXTURBOXx](https://github.com/ThexXTURBOXx) made their first contribution +- [@ThexXTURBOXx](https://github.com/ThexXTURBOXx) made their first contribution in [#743](https://github.com/GradleUp/shadow/pull/743) -* [@qian0817](https://github.com/qian0817) made their first contribution +- [@qian0817](https://github.com/qian0817) made their first contribution in [#765](https://github.com/GradleUp/shadow/pull/765) -* [@staktrace](https://github.com/staktrace) made their first contribution +- [@staktrace](https://github.com/staktrace) made their first contribution in [#724](https://github.com/GradleUp/shadow/pull/724) -* [@netomi](https://github.com/netomi) made their first contribution +- [@netomi](https://github.com/netomi) made their first contribution in [#798](https://github.com/GradleUp/shadow/pull/798) -* [@codecholeric](https://github.com/codecholeric) made their first contribution +- [@codecholeric](https://github.com/codecholeric) made their first contribution in [#817](https://github.com/GradleUp/shadow/pull/817) -* [@jebnix](https://github.com/jebnix) made their first contribution +- [@jebnix](https://github.com/jebnix) made their first contribution in [#800](https://github.com/GradleUp/shadow/pull/800) -* [@eskatos](https://github.com/eskatos) made their first contribution +- [@eskatos](https://github.com/eskatos) made their first contribution in [#821](https://github.com/GradleUp/shadow/pull/821) -* [@simPod](https://github.com/simPod) made their first contribution +- [@simPod](https://github.com/simPod) made their first contribution in [#622](https://github.com/GradleUp/shadow/pull/622) -* [@Goooler](https://github.com/Goooler) made their first contribution +- [@Goooler](https://github.com/Goooler) made their first contribution in [#822](https://github.com/GradleUp/shadow/pull/822) -* [@ElisaMin](https://github.com/ElisaMin) made their first contribution +- [@ElisaMin](https://github.com/ElisaMin) made their first contribution in [#791](https://github.com/GradleUp/shadow/pull/791) **Full Changelog**: [`7.1.2...8.0.0`](https://github.com/GradleUp/shadow/compare/7.1.2...8.0.0) diff --git a/docs/getting-started/README.md b/docs/getting-started/README.md index 7c25e469ba..0e663d0ee0 100644 --- a/docs/getting-started/README.md +++ b/docs/getting-started/README.md @@ -120,25 +120,25 @@ This means, that for most users, the `java` or `groovy` plugins must be _explici In the presence of the `java`, `org.jetbrains.kotlin.jvm` or `groovy` plugins (that apply [`JavaPlugin`][JavaPlugin] in their build logic), Shadow will automatically configure the following behavior: -* Adds a [`ShadowJar`][ShadowJar] task to the project. -* Adds a `shadow` configuration to the project. -* Adds a `shadow` variant to the project. -* Adds a `shadow` component to the project. -* Configures the [`ShadowJar`][ShadowJar] task to include all sources from the project's `main` sourceSet. -* Configures the [`ShadowJar`][ShadowJar] task to bundle all dependencies from the `runtimeClasspath` configuration. -* Configures the _classifier_ attribute of the [`ShadowJar`][ShadowJar] task to be `'all'` . -* Configures the [`ShadowJar`][ShadowJar] task to generate a `Manifest` with: - * Inheriting all configuration from the standard [`Jar`][Jar] task. - * Adds a `Class-Path` attribute to the `Manifest` that appends all dependencies from the `shadow` configuration -* Configures the [`ShadowJar`][ShadowJar] task to _exclude_ any JAR index or cryptographic signature files matching the +- Adds a [`ShadowJar`][ShadowJar] task to the project. +- Adds a `shadow` configuration to the project. +- Adds a `shadow` variant to the project. +- Adds a `shadow` component to the project. +- Configures the [`ShadowJar`][ShadowJar] task to include all sources from the project's `main` sourceSet. +- Configures the [`ShadowJar`][ShadowJar] task to bundle all dependencies from the `runtimeClasspath` configuration. +- Configures the _classifier_ attribute of the [`ShadowJar`][ShadowJar] task to be `'all'` . +- Configures the [`ShadowJar`][ShadowJar] task to generate a `Manifest` with: + - Inheriting all configuration from the standard [`Jar`][Jar] task. + - Adds a `Class-Path` attribute to the `Manifest` that appends all dependencies from the `shadow` configuration +- Configures the [`ShadowJar`][ShadowJar] task to _exclude_ any JAR index or cryptographic signature files matching the following patterns: - * `META-INF/INDEX.LIST` - * `META-INF/*.SF` - * `META-INF/*.DSA` - * `META-INF/*.RSA` - * `META-INF/versions/**/module-info.class` - * `module-info.class` -* Creates and registers the `shadow` component in the project (used for integrating with + - `META-INF/INDEX.LIST` + - `META-INF/*.SF` + - `META-INF/*.DSA` + - `META-INF/*.RSA` + - `META-INF/versions/**/module-info.class` + - `module-info.class` +- Creates and registers the `shadow` component in the project (used for integrating with [`maven-publish`][maven-publish]). ## ShadowJar Command Line options From 0e331904c4e3860d01aa3779530c622f651f56c3 Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 24 Aug 2026 13:55:19 +0800 Subject: [PATCH 05/11] Reformat --- docs/configuration/merging/README.md | 4 ++-- docs/configuration/relocation/README.md | 16 ++++++++-------- docs/kotlin-plugins/README.md | 5 ++--- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/configuration/merging/README.md b/docs/configuration/merging/README.md index 289d9d75f5..5c326e06fb 100644 --- a/docs/configuration/merging/README.md +++ b/docs/configuration/merging/README.md @@ -548,8 +548,8 @@ syntax method of [`append(String)`][ShadowJar.append] to configure this transfor ## Appending XML Files -XML files require a special transformer for merging. The [`XmlAppendingTransformer`][XmlAppendingTransformer] reads -each XML document and merges each root element into a single document. There is no short syntax method for the +XML files require a special transformer for merging. The [`XmlAppendingTransformer`][XmlAppendingTransformer] reads each +XML document and merges each root element into a single document. There is no short syntax method for the [`XmlAppendingTransformer`][XmlAppendingTransformer]. It must be added using the [`transform`][ShadowJar.transform] methods. diff --git a/docs/configuration/relocation/README.md b/docs/configuration/relocation/README.md index dc7dd714d2..8bfe7afaba 100644 --- a/docs/configuration/relocation/README.md +++ b/docs/configuration/relocation/README.md @@ -28,8 +28,8 @@ Any non-class files that are stored within a package structure are also relocate ``` The code snippet will rewrite the location for any class in the `junit.framework` to be `shadow.junit`. For example, the -class `junit.framework.TestCase` becomes `shadow.junit.TestCase`. In the resulting JAR, the class file is relocated -from `junit/framework/TestCase.class` to `shadow/junit/TestCase.class`. +class `junit.framework.TestCase` becomes `shadow.junit.TestCase`. In the resulting JAR, the class file is relocated from +`junit/framework/TestCase.class` to `shadow/junit/TestCase.class`. !!! warning "Scope of Relocation" @@ -313,12 +313,12 @@ To use R8 for package relocation, enable R8 under `minimize` and provide ProGuar ### Comparison: Shadow `relocate` vs. R8 Repackaging -| Feature | Shadow `relocate` (`SimpleRelocator`) | R8 Repackaging (`-repackageclasses`) | -|:---|:---|:---| -| **Execution Stage** | During JAR merging (ASM bytecode transformation) | Post-merge whole-program optimization | -| **Relocation Scope** | Explicit per-prefix or per-class pattern matching | Whole-program automatic relocation | -| **Visibility Handling** | Direct string/type renaming (no visibility check) | Analyzes package-private & protected constraints | -| **Shrinking / Obfuscation** | Relocation only | Combined with shrinking (optional name obfuscation) | +| Feature | Shadow `relocate` (`SimpleRelocator`) | R8 Repackaging (`-repackageclasses`) | +|:----------------------------|:--------------------------------------------------|:----------------------------------------------------| +| **Execution Stage** | During JAR merging (ASM bytecode transformation) | Post-merge whole-program optimization | +| **Relocation Scope** | Explicit per-prefix or per-class pattern matching | Whole-program automatic relocation | +| **Visibility Handling** | Direct string/type renaming (no visibility check) | Analyzes package-private & protected constraints | +| **Shrinking / Obfuscation** | Relocation only | Combined with shrinking (optional name obfuscation) | [#1622]: https://github.com/GradleUp/shadow/issues/1622 diff --git a/docs/kotlin-plugins/README.md b/docs/kotlin-plugins/README.md index c03bbfd0f5..95c1036ad5 100644 --- a/docs/kotlin-plugins/README.md +++ b/docs/kotlin-plugins/README.md @@ -59,9 +59,8 @@ Shadow works well for Kotlin JVM projects like Java projects. Here is an example } ``` -You can mix the Kotlin JVM plugin with `java-gradle-plugin`, `application`, and other Java plugins, easily organize -your build logic for [Publishing Libraries][publishing-libraries], [Running Applications][running-applications], -and so on. +You can mix the Kotlin JVM plugin with `java-gradle-plugin`, `application`, and other Java plugins, easily organize your +build logic for [Publishing Libraries][publishing-libraries], [Running Applications][running-applications], and so on. ## For Kotlin Multiplatform Plugin From 12b5b8617648db2af1ae5cf0a930d6eccadf5b14 Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 24 Aug 2026 13:57:20 +0800 Subject: [PATCH 06/11] Refine code block formatting and language tags in changelog --- docs/changes/README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/changes/README.md b/docs/changes/README.md index 09f7c86dd4..492b0f169b 100644 --- a/docs/changes/README.md +++ b/docs/changes/README.md @@ -89,12 +89,12 @@ With the introduction of `DuplicatesStrategy` checking for transformers, you may see warnings like: ``` -'META-INF/...kotlin_module' is matched by com.github.jengelman.gradle.plugins.shadow.transformers.KotlinModuleMetadataTransformer but its DuplicatesStrategy is EXCLUDE — duplicates may be silently dropped before the transformer processes them. + 'META-INF/...kotlin_module' is matched by com.github.jengelman.gradle.plugins.shadow.transformers.KotlinModuleMetadataTransformer but its DuplicatesStrategy is EXCLUDE — duplicates may be silently dropped before the transformer processes them. ``` If you do not need Kotlin module metadata remapping, you can disable it: - ```kt + ```kotlin tasks.shadowJar { @Suppress("DEPRECATION") // This flag will be disabled and removed in the next major version of Shadow. enableKotlinModuleRemapping = false @@ -451,17 +451,17 @@ issues that are hard to fix. Now it behaves like Gradle's `AbstractCopyTask.from`, which means it will not unzip the files, only copy the files as-is. If you still want to shadow the unzipped files, try out something like: ```kotlin - tasks.shadowJar { - // Unzip the files before pass them to `from` by using `zipTree`. - from(zipTree(files('path/to/your/file.zip'))) - } + tasks.shadowJar { + // Unzip the files before pass them to `from` by using `zipTree`. + from(zipTree(files("path/to/your/file.zip"))) + } ``` or ```kotlin - dependencies { - // Add the files to `implementation` configuration, Shadow will unzip them automatically. - implementation(files('path/to/your/file.zip')) - } + dependencies { + // Add the files to `implementation` configuration, Shadow will unzip them automatically. + implementation(files("path/to/your/file.zip")) + } ``` - **BREAKING CHANGE:** Rename `Transformer` to `ResourceTransformer`. ([#1288](https://github.com/GradleUp/shadow/pull/1288)) Aims to better align with the name `org.apache.maven.plugins.shade.resource.ResourceTransformer.java` @@ -863,7 +863,7 @@ type. `gradle.plugin.com.github.jengelman.gradle.plugins`. Users explicitly declaring the buildscript classpath will need to update their configuration. - ``` + ```groovy buildscript { repositories { gradlePluginPortal() From 9b2f8975398bab52e7cd73b8ceaddc15184c5f1b Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 24 Aug 2026 14:00:21 +0800 Subject: [PATCH 07/11] Fix tests --- docs/changes/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/changes/README.md b/docs/changes/README.md index 492b0f169b..60c3a0921c 100644 --- a/docs/changes/README.md +++ b/docs/changes/README.md @@ -94,7 +94,7 @@ If you do not need Kotlin module metadata remapping, you can disable it: - ```kotlin + ``` tasks.shadowJar { @Suppress("DEPRECATION") // This flag will be disabled and removed in the next major version of Shadow. enableKotlinModuleRemapping = false @@ -863,7 +863,7 @@ type. `gradle.plugin.com.github.jengelman.gradle.plugins`. Users explicitly declaring the buildscript classpath will need to update their configuration. - ```groovy + ``` buildscript { repositories { gradlePluginPortal() From 3f05b0ee2fbe2a2efe63f4936651e9a7a69c2ece Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 24 Aug 2026 20:34:09 +0800 Subject: [PATCH 08/11] Fix split link brackets across lines --- docs/application-plugin/README.md | 4 ++-- docs/changes/README.md | 2 +- docs/configuration/merging/README.md | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/application-plugin/README.md b/docs/application-plugin/README.md index 0a1712a76e..15a33a6cc7 100644 --- a/docs/application-plugin/README.md +++ b/docs/application-plugin/README.md @@ -3,8 +3,8 @@ Shadow reacts to the presence of Gradle's [`application`][application] plugin and will automatically configure additional tasks for running the shadowed JAR and creating distributions containing the shadowed JAR. -Just like the normal [`Jar`][Jar] task, when the [`application`][application] plugin is applied, the [ -`ShadowJar`][ShadowJar] manifest will be configured to contain the `Main-Class` attribute with the value specified in +Just like the normal [`Jar`][Jar] task, when the [`application`][application] plugin is applied, the +[`ShadowJar`][ShadowJar] manifest will be configured to contain the `Main-Class` attribute with the value specified in the project's `application.mainClass` attribute. === "Kotlin" diff --git a/docs/changes/README.md b/docs/changes/README.md index 60c3a0921c..bd77fdbd2d 100644 --- a/docs/changes/README.md +++ b/docs/changes/README.md @@ -1153,7 +1153,7 @@ type. - Make service files root path configurable for `ServiceFileTransformer`, [#72](https://github.com/GradleUp/shadow/issues/72) -- [Andres Almiray](https://github.com/aalmiray - Added +- [Andres Almiray](https://github.com/aalmiray) - Added PropertiesFileTransformer, [#73](https://github.com/GradleUp/shadow/issues/73) - [Brandon Kearby](https://github.com/brandonkearby) - Fixed StackOverflow when a cycle occurs in the resolved dependency grap, [#69](https://github.com/GradleUp/shadow/pull/69) diff --git a/docs/configuration/merging/README.md b/docs/configuration/merging/README.md index 5c326e06fb..21aed86e82 100644 --- a/docs/configuration/merging/README.md +++ b/docs/configuration/merging/README.md @@ -330,9 +330,9 @@ runtime, this file is read and used to configure library or application behavior Multiple dependencies may use the same service descriptor file name. In this case, it is generally desired to merge the content of each instance of the file into a single output file. The [`ServiceFileTransformer`][ServiceFileTransformer] class is used to perform this merging. By default, it will merge each copy of a file under `META-INF/services` into a -single file in the output JAR. You can use either the short syntax method [ -`mergeServiceFiles()`][ShadowJar.mergeServiceFiles] or the full syntax method [`transform`][ShadowJar.transform] to add -the [`ServiceFileTransformer`][ServiceFileTransformer]: +single file in the output JAR. You can use either the short syntax method +[`mergeServiceFiles()`][ShadowJar.mergeServiceFiles] or the full syntax method [`transform`][ShadowJar.transform] to +add the [`ServiceFileTransformer`][ServiceFileTransformer]: === "Kotlin" @@ -444,9 +444,9 @@ from merging. ## Merging Groovy Extension Modules Shadow provides a specific transformer for dealing with Groovy extension module files. This is due to their special -syntax and how they need to be merged together. The [ -`GroovyExtensionModuleTransformer`][GroovyExtensionModuleTransformer] will handle these files. The [ -`ShadowJar`][ShadowJar] task also provides a short syntax method to add this transformer. +syntax and how they need to be merged together. The +[`GroovyExtensionModuleTransformer`][GroovyExtensionModuleTransformer] will handle these files. The +[`ShadowJar`][ShadowJar] task also provides a short syntax method to add this transformer. === "Kotlin" From 50a000601fd33bcf5e8b33740494ae1dd5d9df30 Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 24 Aug 2026 20:42:14 +0800 Subject: [PATCH 09/11] Compat images --- docs/images/logo+type.orig.svg | 2 +- docs/images/logo.orig.svg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/images/logo+type.orig.svg b/docs/images/logo+type.orig.svg index 53a67c8305..2f47c36ea5 100644 --- a/docs/images/logo+type.orig.svg +++ b/docs/images/logo+type.orig.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/docs/images/logo.orig.svg b/docs/images/logo.orig.svg index 1079d031ef..60ed6c2f32 100644 --- a/docs/images/logo.orig.svg +++ b/docs/images/logo.orig.svg @@ -1 +1 @@ - + \ No newline at end of file From 28db53e5364fc7802742f239360156cbc42d5cc2 Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 24 Aug 2026 20:49:42 +0800 Subject: [PATCH 10/11] Keep What's Changed and New Contributors items on single lines --- docs/changes/README.md | 114 ++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 76 deletions(-) diff --git a/docs/changes/README.md b/docs/changes/README.md index bd77fdbd2d..dae282ca26 100644 --- a/docs/changes/README.md +++ b/docs/changes/README.md @@ -706,29 +706,19 @@ See more details about the fixed `DuplicatesStrategy` behaviors at [Handling Dup ### What's Changed -- Replace deprecated ConfigureUtil by [@Goooler](https://github.com/Goooler) - in [#826](https://github.com/GradleUp/shadow/pull/826) -- Polish outdated configs by [@Goooler](https://github.com/Goooler) - in [#831](https://github.com/GradleUp/shadow/pull/831) -- Update plugin com.gradle.enterprise to v3.12.5 by [@renovate](https://github.com/renovate-bot) - in [#838](https://github.com/GradleUp/shadow/pull/838) -- Update dependency gradle to v8.0.2 by [@renovate](https://github.com/renovate-bot) - in [#844](https://github.com/GradleUp/shadow/pull/844) -- fix(deps): update dependency org.codehaus.plexus:plexus-utils to v3.5.1 - by [@renovate](https://github.com/renovate-bot) in [#837](https://github.com/GradleUp/shadow/pull/837) -- chore(deps): update dependency prismjs to v1.27.0 [security] by [@renovate](https://github.com/renovate-bot) - in [#828](https://github.com/GradleUp/shadow/pull/828) -- Encode transformed properties files with specified Charset by [@scottsteen](https://github.com/scottsteen) - in [#819](https://github.com/GradleUp/shadow/pull/819) -- chore(deps): update dependency vuepress to v1.9.9 by [@renovate](https://github.com/renovate-bot) - in [#842](https://github.com/GradleUp/shadow/pull/842) +- Replace deprecated ConfigureUtil by [@Goooler](https://github.com/Goooler) in [#826](https://github.com/GradleUp/shadow/pull/826) +- Polish outdated configs by [@Goooler](https://github.com/Goooler) in [#831](https://github.com/GradleUp/shadow/pull/831) +- Update plugin com.gradle.enterprise to v3.12.5 by [@renovate](https://github.com/renovate-bot) in [#838](https://github.com/GradleUp/shadow/pull/838) +- Update dependency gradle to v8.0.2 by [@renovate](https://github.com/renovate-bot) in [#844](https://github.com/GradleUp/shadow/pull/844) +- fix(deps): update dependency org.codehaus.plexus:plexus-utils to v3.5.1 by [@renovate](https://github.com/renovate-bot) in [#837](https://github.com/GradleUp/shadow/pull/837) +- chore(deps): update dependency prismjs to v1.27.0 [security] by [@renovate](https://github.com/renovate-bot) in [#828](https://github.com/GradleUp/shadow/pull/828) +- Encode transformed properties files with specified Charset by [@scottsteen](https://github.com/scottsteen) in [#819](https://github.com/GradleUp/shadow/pull/819) +- chore(deps): update dependency vuepress to v1.9.9 by [@renovate](https://github.com/renovate-bot) in [#842](https://github.com/GradleUp/shadow/pull/842) ### New Contributors -- [@renovate](https://github.com/renovate-bot) made their first contribution - in [#838](https://github.com/GradleUp/shadow/pull/838) -- [@scottsteen](https://github.com/scottsteen) made their first contribution - in [#819](https://github.com/GradleUp/shadow/pull/819) +- [@renovate](https://github.com/renovate-bot) made their first contribution in [#838](https://github.com/GradleUp/shadow/pull/838) +- [@scottsteen](https://github.com/scottsteen) made their first contribution in [#819](https://github.com/GradleUp/shadow/pull/819) **Full Changelog**: [`8.1.0...8.1.1`](https://github.com/GradleUp/shadow/compare/8.1.0...8.1.1) @@ -749,13 +739,11 @@ type. - Minor cleanups by [@Goooler](https://github.com/Goooler) in [#823](https://github.com/GradleUp/shadow/pull/823) - Support config cache by [@Goooler](https://github.com/Goooler) in [#824](https://github.com/GradleUp/shadow/pull/824) -- Fix RelocatorRemapper: do not map inner class name if not changed by [@Him188](https://github.com/Him188) - in [#793](https://github.com/GradleUp/shadow/pull/793) +- Fix RelocatorRemapper: do not map inner class name if not changed by [@Him188](https://github.com/Him188) in [#793](https://github.com/GradleUp/shadow/pull/793) ### New Contributors -- [@Him188](https://github.com/Him188) made their first contribution - in [#793](https://github.com/GradleUp/shadow/pull/793) +- [@Him188](https://github.com/Him188) made their first contribution in [#793](https://github.com/GradleUp/shadow/pull/793) **Full Changelog**: [`8.0.0...8.1.0`](https://github.com/GradleUp/shadow/compare/8.0.0...8.1.0) @@ -763,62 +751,36 @@ type. ### What's Changed -- Fix the plugin dependency identifier in the docs by [@lnhrdt](https://github.com/lnhrdt) - in [#754](https://github.com/GradleUp/shadow/pull/754) -- mergeGroovyExtensionModules() not working with Groovy 2.5+ by [@paulk-asert](https://github.com/paulk-asert) - in [#779](https://github.com/GradleUp/shadow/pull/779) -- Upgrade to ASM 9.3 to support JDK 19. by [@vyazelenko](https://github.com/vyazelenko) - in [#770](https://github.com/GradleUp/shadow/pull/770) -- Do not add a dependencies block if it's already there by [@desiderantes](https://github.com/desiderantes) - in [#769](https://github.com/GradleUp/shadow/pull/769) -- Update README with new badge and links by [@ThexXTURBOXx](https://github.com/ThexXTURBOXx) - in [#743](https://github.com/GradleUp/shadow/pull/743) -- Fix value not set when rawString is true. by [@qian0817](https://github.com/qian0817) - in [#765](https://github.com/GradleUp/shadow/pull/765) -- Mark the Log4j2PluginsCacheFileTransformer as cacheable. by [@staktrace](https://github.com/staktrace) - in [#724](https://github.com/GradleUp/shadow/pull/724) -- Fix retrieval of dependencies node when publishing by [@netomi](https://github.com/netomi) - in [#798](https://github.com/GradleUp/shadow/pull/798) -- Upgrade dependency ASM from `9.3` to `9.4` by [@codecholeric](https://github.com/codecholeric) - in [#817](https://github.com/GradleUp/shadow/pull/817) -- Fix a typo of code comment in the minimizing page by [@jebnix](https://github.com/jebnix) - in [#800](https://github.com/GradleUp/shadow/pull/800) -- Prefer using plugin extensions over deprecated conventions by [@eskatos](https://github.com/eskatos) - in [#821](https://github.com/GradleUp/shadow/pull/821) -- Introduce CleanProperties by [@simPod](https://github.com/simPod) - in [#622](https://github.com/GradleUp/shadow/pull/622) +- Fix the plugin dependency identifier in the docs by [@lnhrdt](https://github.com/lnhrdt) in [#754](https://github.com/GradleUp/shadow/pull/754) +- mergeGroovyExtensionModules() not working with Groovy 2.5+ by [@paulk-asert](https://github.com/paulk-asert) in [#779](https://github.com/GradleUp/shadow/pull/779) +- Upgrade to ASM 9.3 to support JDK 19. by [@vyazelenko](https://github.com/vyazelenko) in [#770](https://github.com/GradleUp/shadow/pull/770) +- Do not add a dependencies block if it's already there by [@desiderantes](https://github.com/desiderantes) in [#769](https://github.com/GradleUp/shadow/pull/769) +- Update README with new badge and links by [@ThexXTURBOXx](https://github.com/ThexXTURBOXx) in [#743](https://github.com/GradleUp/shadow/pull/743) +- Fix value not set when rawString is true. by [@qian0817](https://github.com/qian0817) in [#765](https://github.com/GradleUp/shadow/pull/765) +- Mark the Log4j2PluginsCacheFileTransformer as cacheable. by [@staktrace](https://github.com/staktrace) in [#724](https://github.com/GradleUp/shadow/pull/724) +- Fix retrieval of dependencies node when publishing by [@netomi](https://github.com/netomi) in [#798](https://github.com/GradleUp/shadow/pull/798) +- Upgrade dependency ASM from `9.3` to `9.4` by [@codecholeric](https://github.com/codecholeric) in [#817](https://github.com/GradleUp/shadow/pull/817) +- Fix a typo of code comment in the minimizing page by [@jebnix](https://github.com/jebnix) in [#800](https://github.com/GradleUp/shadow/pull/800) +- Prefer using plugin extensions over deprecated conventions by [@eskatos](https://github.com/eskatos) in [#821](https://github.com/GradleUp/shadow/pull/821) +- Introduce CleanProperties by [@simPod](https://github.com/simPod) in [#622](https://github.com/GradleUp/shadow/pull/622) - Support Gradle 8.0 by [@Goooler](https://github.com/Goooler) in [#822](https://github.com/GradleUp/shadow/pull/822) -- Updated dependencies, Gradle versions and Fix Test by [@ElisaMin](https://github.com/ElisaMin) - in [#791](https://github.com/GradleUp/shadow/pull/791) +- Updated dependencies, Gradle versions and Fix Test by [@ElisaMin](https://github.com/ElisaMin) in [#791](https://github.com/GradleUp/shadow/pull/791) ### New Contributors -- [@lnhrdt](https://github.com/lnhrdt) made their first contribution - in [#754](https://github.com/GradleUp/shadow/pull/754) -- [@paulk-asert](https://github.com/paulk-asert) made their first contribution - in [#779](https://github.com/GradleUp/shadow/pull/779) -- [@desiderantes](https://github.com/desiderantes) made their first contribution - in [#769](https://github.com/GradleUp/shadow/pull/769) -- [@ThexXTURBOXx](https://github.com/ThexXTURBOXx) made their first contribution - in [#743](https://github.com/GradleUp/shadow/pull/743) -- [@qian0817](https://github.com/qian0817) made their first contribution - in [#765](https://github.com/GradleUp/shadow/pull/765) -- [@staktrace](https://github.com/staktrace) made their first contribution - in [#724](https://github.com/GradleUp/shadow/pull/724) -- [@netomi](https://github.com/netomi) made their first contribution - in [#798](https://github.com/GradleUp/shadow/pull/798) -- [@codecholeric](https://github.com/codecholeric) made their first contribution - in [#817](https://github.com/GradleUp/shadow/pull/817) -- [@jebnix](https://github.com/jebnix) made their first contribution - in [#800](https://github.com/GradleUp/shadow/pull/800) -- [@eskatos](https://github.com/eskatos) made their first contribution - in [#821](https://github.com/GradleUp/shadow/pull/821) -- [@simPod](https://github.com/simPod) made their first contribution - in [#622](https://github.com/GradleUp/shadow/pull/622) -- [@Goooler](https://github.com/Goooler) made their first contribution - in [#822](https://github.com/GradleUp/shadow/pull/822) -- [@ElisaMin](https://github.com/ElisaMin) made their first contribution - in [#791](https://github.com/GradleUp/shadow/pull/791) +- [@lnhrdt](https://github.com/lnhrdt) made their first contribution in [#754](https://github.com/GradleUp/shadow/pull/754) +- [@paulk-asert](https://github.com/paulk-asert) made their first contribution in [#779](https://github.com/GradleUp/shadow/pull/779) +- [@desiderantes](https://github.com/desiderantes) made their first contribution in [#769](https://github.com/GradleUp/shadow/pull/769) +- [@ThexXTURBOXx](https://github.com/ThexXTURBOXx) made their first contribution in [#743](https://github.com/GradleUp/shadow/pull/743) +- [@qian0817](https://github.com/qian0817) made their first contribution in [#765](https://github.com/GradleUp/shadow/pull/765) +- [@staktrace](https://github.com/staktrace) made their first contribution in [#724](https://github.com/GradleUp/shadow/pull/724) +- [@netomi](https://github.com/netomi) made their first contribution in [#798](https://github.com/GradleUp/shadow/pull/798) +- [@codecholeric](https://github.com/codecholeric) made their first contribution in [#817](https://github.com/GradleUp/shadow/pull/817) +- [@jebnix](https://github.com/jebnix) made their first contribution in [#800](https://github.com/GradleUp/shadow/pull/800) +- [@eskatos](https://github.com/eskatos) made their first contribution in [#821](https://github.com/GradleUp/shadow/pull/821) +- [@simPod](https://github.com/simPod) made their first contribution in [#622](https://github.com/GradleUp/shadow/pull/622) +- [@Goooler](https://github.com/Goooler) made their first contribution in [#822](https://github.com/GradleUp/shadow/pull/822) +- [@ElisaMin](https://github.com/ElisaMin) made their first contribution in [#791](https://github.com/GradleUp/shadow/pull/791) **Full Changelog**: [`7.1.2...8.0.0`](https://github.com/GradleUp/shadow/compare/7.1.2...8.0.0) From 2370603e15f5c50946b76c183ac9655bd41376b8 Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 24 Aug 2026 20:51:36 +0800 Subject: [PATCH 11/11] Fix groovy block --- docs/changes/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/changes/README.md b/docs/changes/README.md index dae282ca26..aac5bb1cbd 100644 --- a/docs/changes/README.md +++ b/docs/changes/README.md @@ -457,10 +457,10 @@ } ``` or - ```kotlin + ```groovy dependencies { // Add the files to `implementation` configuration, Shadow will unzip them automatically. - implementation(files("path/to/your/file.zip")) + implementation(files('path/to/your/file.zip')) } ``` - **BREAKING CHANGE:** Rename `Transformer` to `ResourceTransformer`. ([#1288](https://github.com/GradleUp/shadow/pull/1288))