Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork422
Releases: GradleUp/shadow
9.2.2
Fixed
- Fix the regression of registering
ShadowJartasks withoutShadowPluginapplied. (#1787)
Assets2
Uh oh!
There was an error while loading.Please reload this page.
9.2.1
Added
- Support relocating Groovy extensions in Module descriptors. (#1705)
- Add extensions for
Iterable<Relocator>. (#1710) - Support relocating list of types in
RelocatorRemapper. (#1714) - Add
mainClassproperty intoShadowJar. (#1722)tasks.shadowJar {// This property will be used as a fallback if there is no explicit `Main-Class` attribute set. mainClass="my.Main"} - Honor
executableDirandapplicationNameinapplicationextension. (#1740)
This is useful when you want to customize the output directory of the start scripts and the application distribution. - Provide more task accessors in
ShadowApplicationPlugin.Companion. (#1771) - Support relocating Kotlin module files. (#1539)
The current implementation relocates all properties inKotlinModuleMetadatabutKmModule.optionalAnnotationClassesdue to very limited usage of it. See more discussionhere. - Allow overriding
BUNDLING_ATTRIBUTEin GMM. (#1773)
Theorg.gradle.dependency.bundlingin shadowed JAR's Gradle Module Metadata is set toshadowedby default. You can override it for now by:shadow { bundlingAttribute=Bundling.EMBEDDED}
Changed
- Merge Gradle Module descriptors into the modern
META-INFpath. (#1706)
The Gradle Module descriptors (org.codehaus.groovy.runtime.ExtensionModulefiles) defined underMETA-INF/services/
andMETA-INF/groovywill be merged intoMETA-INF/groovy/org.codehaus.groovy.runtime.ExtensionModule. - Move injecting
Class-Pathmanifest attr logic fromdoFirstintocopy. (#1720) - Move injecting
Main-Classmanifest attr logic fromdoFirstintocopy. (#1724) - Deprecate
InheritManifestandinheritFrom. (#1722)tasks.shadowJar {// Before (deprecated): manifest.inheritFrom(tasks.jar.get().manifest)// After (recommended): manifest.from(tasks.jar.get().manifest)// Note: You don't need to inherit the manifest from `jar` task as it's done by default for the `shadowJar` task.// But if you want to inherit the manifest for your custom `ShadowJar` task, you still need to do it explicitly.} - Use default
JavaExecerror message when main class is not set. (#1725) - Update
RelocatorRemapperclass pattern to cover more Java method descriptors. (#1731) - Stop using start script templates bundled in Shadow. (#1738)
- Bump min Java requirement to 17. (#1744)
- Require most optional properties non-null. (#1745)
- Make assemble depend on shadowJar even if it is added later. (#1766)
Fixed
- Fix excluding dependencies whose versions contain
+. (#1597)
Assets2
Uh oh!
There was an error while loading.Please reload this page.
9.1.0
Added
- Allow opting out of
shadowRuntimeElementsvariant. (#1662)shadow {// Disable publishing `shadowRuntimeElements` as an optional variant of the `java` component. addShadowVariantIntoJavaComponent=false}// configuration must be done in the `afterEvaluate` phase, you cannot access `shadowRuntimeElements` before that.val javaComponent= components["java"]asAdhocComponentWithVariantsjavaComponent.withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) {// See more details in https://github.com/GradleUp/shadow/pull/1662. skip()} - Allow opting out of
TARGET_JVM_VERSION_ATTRIBUTE. (#1674)shadow {// Disable adding `TargetJvmVersion` attribute into the Gradle Module Metadata of the shadowed jar. addTargetJvmVersionAttribute=false} - Allow opting out of
Multi-Releaseattribute. (#1675)tasks.shadowJar {// Disable adding `Multi-Release` attribute into the manifest of the shadowed jar. addMultiReleaseAttribute=false}
Changed
Assets2
Uh oh!
There was an error while loading.Please reload this page.
9.0.2
Fixed
Assets2
Uh oh!
There was an error while loading.Please reload this page.
9.0.1
Note
If you are upgrading from 8.x versions, please read9.0.0 release notes first.
Tip
You can diff the shadowed JARs when upgrading from 8.x to 9.x by usingDiffuse.
If there are any things missing in the changelog or the doc site, please report them to us.
Changed
- Improve the error message for empty
mainClassName. (#1601) - Default
duplicatesStrategyback toEXCLUDE. (#1617)- This strategy is consistent with 8.x series behavior, which is more compatible for most users upgrading.
- For most
ResourceTransformerusers, you need to override the strategy toINCLUDEto make them work. - Strongly suggest declaring the
duplicatesStrategyexplicitly in yourShadowJarconfiguration to avoid confusion. - See more details about the strategies atHandling Duplicates Strategy.
Fixed
Assets2
Uh oh!
There was an error while loading.Please reload this page.
9.0.0
Warning
This release is a major update from the 8.x series. The plugin has been fully rewritten in Kotlin, bringing
significant improvements to maintainability, performance, and future extensibility. It introduces many new features,
enhancements, and bug fixes, and includes several breaking changes. Please review the changelog carefully and consult
thenew doc site before upgrading.
If you really don't want to upgrade, you can still use the 8.3.x, which is also Gradle 9 compatible. But no additional features or crucial bug fixes will be included in the 8.x line.
Tip
You can diff the shadowed JARs when upgrading from 8.x to 9.x by usingDiffuse.
If there are any things missing in the changelog or the doc site, please report them to us.
Added
- Add .md support to the Apache License and Notice transformers. (#1041)
- Sync
SimpleRelocatorchanges from maven-shade-plugin. (#1076) - Support configuring
separatorinAppendingTransformer. (#1169)
This is useful for handling files likeresources/application.yml. - Exclude
module-info.classin Multi-Release folders by default. (#1177) - Inject
TargetJvmVersionattribute for Gradle Module Metadata. (#1199) - Sync
ShadowApplicationPluginwithApplicationPlugin. (#1224) - Inject
Multi-Releasemanifest attribute if any dependency contains it. (#1239) - Mark
Transformeras throwingIOException. (#1248) - Reduce duplicate
SimpleRelocatorto improve performance. (#1271) - Compat Kotlin Multiplatform plugin. (#1280)
- Add Kotlin DSL examples in docs. (#1306)
- Support using type-safe dependency accessors in
ShadowJar.dependencies. (#1322) - Support command line options for
ShadowJar. (#1365)--enable-auto-relocation Enables auto relocation of packages in the dependencies.--no-enable-auto-relocation Disables option --enable-auto-relocation.--fail-on-duplicate-entries Fails build if the ZIP entries in the shadowed JAR are duplicate.--no-fail-on-duplicate-entries Disables option --fail-on-duplicate-entries.--minimize-jar Minimizes the jar by removing unused classes.--no-minimize-jar Disables option --minimize-jar.--relocation-prefix Prefix used for auto relocation of packages in the dependencies.--rerun Causes the task to be re-run even if up-to-date. - Support skipping string constant remapping. (#1401)
- Let
assembledepend onshadowJar. (#1524) - Fail build when inputting AAR files or using Shadow with AGP. (#1530)
- Add
PreserveFirstFoundResourceTransformer. (#1548)
This is useful when you setshadowJar.duplicatesStrategy = DuplicatesStrategy.INCLUDEand
want to ensure that only the first found resource is included in the final JAR. - Fail build if the ZIP entries in the shadowed JAR are duplicate. (#1552)
This feature is controlled by theshadowJar.failOnDuplicateEntriesproperty, which isfalseby default.
Related to settingduplicatesStrategy = DuplicatesStrategy.FAILbut there are some differences:- It only checks the entries in the shadowed jar, not the input files.
- It works with setting
duplicatesStrategyto any value. - It provides a stricter fallback check before the JAR is created.
Changed
- BREAKING CHANGE: Rewrite this plugin in Kotlin. (#1012)
- BREAKING CHANGE: Migrate
Transformers to using lazy properties. (#1036) - BREAKING CHANGE: Migrate
ShadowJarto using lazy properties. (#1044) - BREAKING CHANGE: Resolve
Configurationdirectly inDependencyFilter. (#1045) - BREAKING CHANGE: Migrate
SimpleRelocatorto using lazy properties. (#1047) - BREAKING CHANGE: Some public getters have been updated in
SimpleRelocator. (#1079) - BREAKING CHANGE: Migrate all
ListPropertyusages toSetProperty. (#1103)
Some publicListparameters are also changed toSet. - BREAKING CHANGE: Mark
RelocatorRemapperasinternal. (#1227) - BREAKING CHANGE: Bump min Java requirement to 11. (#1242)
- BREAKING CHANGE: Move tracking unused classes logic out of
ShadowCopyAction. (#1257) - BREAKING CHANGE: Move
DependencyFilterintotaskspackage. (#1272) - BREAKING CHANGE: Change the default
duplicatesStrategyfromEXCLUDEtoINCLUDE. (#1233)ShadowJarrecognizedEXCLUDEas the default, but the other strategies didn't work properly.- Now
ShadowJarhonorsINCLUDEas the default, and aligns all the strategy behaviors with the Gradle side. - Some
ResourceTransformers (e.g.ServiceFileTransformer) do not work withEXCLUDE, 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
filesMatchingto override the default strategy for specific files. - Set
failOnDuplicateEntries = trueto fail the build to check for duplicate entries. - See more details atHandling Duplicates Strategy.
- Note: The default
duplicatesStrategyis changed back toEXCLUDEin 9.0.1 release.
- BREAKING CHANGE: Align the behavior of
ShadowTask.fromwith Gradle'sAbstractCopyTask.from. (#1233)
In the previous versions,ShadowTask.fromwould always unzip the files before processing them, which caused serial
issues that are hard to fix. Now it behaves like Gradle'sAbstractCopyTask.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:ortasks.shadowJar {// Unzip the files before pass them to `from` by using `zipTree`. from(zipTree(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
TransformertoResourceTransformer. (#1288)
Aims to better align with the nameorg.apache.maven.plugins.shade.resource.ResourceTransformer.java
and to distinguish itself fromorg.gradle.api.Transformer.java. - BREAKING CHANGE: Mark
DefaultInheritManifestasinternal. (#1303) - BREAKING CHANGE: Polish
ShadowSpec. (#1307)- Return values of
ShadowSpecfunctions are changed toUnitto avoid confusion. ShadowSpecno longer extendsCopySpec.- Overload
relocate,transformand things for better usability in Kotlin.
- Return values of
- BREAKING CHANGE: Remove redundant types from function returning. (#1308)
- BREAKING CHANGE: Rename
ShadowJar'sisEnableRelocationtoenableAutoRelocation. (#1541) - BREAKING CHANGE: Some const values in
ShadowBasePluginandShadowJavaPluginare moved. (#1589)
You can find them inShadowJar,ShadowApplicationPlugin, andShadowJavaPlugin. - Replace deprecated
SelfResolvingDependencywithFileCollectionDependency. (#1114) - Update start script templates. (#1183)
- Mark more
Transformers cacheable. (#1210) - Mark
ShadowJar.dependencyFilteras@Input. (#1206) - Polish
startShadowScriptstask registering. (#1216) - Refactor file visiting logic in
StreamAction, handle file unzipping viaProject.zipTree. (#1233) - Migrate doc sites to MkDocs. (#1302)
runShadowno longer depends oninstallShadowDist. (#1353)- Move the group of
ShadowJarfromshadowtobuild. ([#1355](https...
Assets2
Uh oh!
There was an error while loading.Please reload this page.
8.3.9
Warning
Only Gradle 9 support is being backported to this version. No additional features or crucial bug fixes will be included in the 8.x line. Please migrate to Shadow 9 as soon as possible.
Changed
- Use
BufferedOutputStreamwhen writing the Zip file to improve performance. (#1579)
Assets2
Uh oh!
There was an error while loading.Please reload this page.
9.0.0-rc3
Important
This release is a major update from the 8.3.x series. The plugin has been fully rewritten in Kotlin, bringing significant improvements to maintainability, performance, and future extensibility. It introduces many new features, enhancements, and bug fixes, and includes several breaking changes. Please review the changelog carefully and consult thenew doc site before upgrading.
Added
- Add
PreserveFirstFoundResourceTransformer. (#1548)
This is useful when you setshadowJar.duplicatesStrategy = DuplicatesStrategy.INCLUDE(the default behavior) and want to ensure that only the first found resource is included in the final JAR. - Fail build if the ZIP entries in the shadowed JAR are duplicate. (#1552)
This feature is controlled by theshadowJar.failOnDuplicateEntriesproperty, which isfalseby default.
Related to settingduplicatesStrategy = DuplicatesStrategy.FAILbut there are some differences:- It only checks the entries in the shadowed jar, not the input files.
- It works with setting
duplicatesStrategyto any value. - It provides a more strict check before the JAR is created.
Changed
- BREAKING CHANGE: Rename
ShadowJar'senableRelocationtoenableAutoRelocation. (#1541)
The Command Line options are also updated:--enable-auto-relocation Enables auto relocation of packages in the dependencies.--no-enable-auto-relocation Disables option --enable-auto-relocation.--fail-on-duplicate-entries Fails build if the ZIP entries in the shadowed JAR are duplicate.--no-fail-on-duplicate-entries Disables option --fail-on-duplicate-entries.--minimize-jar Minimizes the jar by removing unused classes.--no-minimize-jar Disables option --minimize-jar.--relocation-prefix Prefix used for auto relocation of packages in the dependencies.--rerun Causes the task to be re-run even if up-to-date. - Mark
Actionparameters as non-null. (#1555)
Removed
- Remove JVM default compat stuff. (#1556)
Assets2
Uh oh!
There was an error while loading.Please reload this page.
9.0.0-rc2
Important
This release is a major update from the 8.3.x series. The plugin has been fully rewritten in Kotlin, bringing significant improvements to maintainability, performance, and future extensibility. It introduces many new features, enhancements, and bug fixes, and includes several breaking changes. Please review the changelog carefully and consult thenew doc site before upgrading.
Added
- Support skipping string constant remapping. (#1401)
- Let
assembledepend onshadowJar. (#1524) - Fail build when inputting AAR files or using Shadow with AGP. (#1530)
Changed
- Restore Develocity Build Scan integration. (#1505)
It is still disabled by default, you can enable it by settingcom.gradleup.shadow.enableDevelocityIntegration = true. - Expose
AbstractDependencyFilterfrominternaltopublic. (#1538)
You can access it viacom.github.jengelman.gradle.plugins.shadow.tasks.DependencyFilter.AbstractDependencyFilter.
Fixed
- Honor
options.releasefor target JVM attribute. (#1502)
Assets2
Uh oh!
There was an error while loading.Please reload this page.
9.0.0-rc1
Important
This release is a major update from the 8.3.x series. The plugin has been fully rewritten in Kotlin, bringing significant improvements to maintainability, performance, and future extensibility. It introduces many new features, enhancements, and bug fixes, and includes several breaking changes. Please review the changelog carefully and consult thenew doc site before upgrading.
Added
- Add .md support to the Apache License and Notice transformers. (#1041)
- Sync
SimpleRelocatorchanges from maven-shade-plugin. (#1076) - Support configuring
separatorinAppendingTransformer. (#1169)
This is useful for handling files likeresources/application.yml. - Exclude
module-info.classin Multi-Release folders by default. (#1177) - Inject
TargetJvmVersionattribute for Gradle Module Metadata. (#1199) - Sync
ShadowApplicationPluginwithApplicationPlugin. (#1224) - Inject
Multi-Releasemanifest attribute if any dependency contains it. (#1239) - Mark
Transformeras throwingIOException. (#1248) - Compat Kotlin Multiplatform plugin. (#1280)
- Add Kotlin DSL examples in docs. (#1306)
- Support using type-safe dependency accessors in
ShadowJar.dependencies. (#1322) - Support command line options for
ShadowJar. (#1365)--enable-relocation Enable relocation of packages in the jar--no-enable-relocation Disables option --enable-relocation--minimize-jar Minimize the jar by removing unused classes--no-minimize-jar Disables option --minimize-jar--relocation-prefix Prefix to use for relocated packages--rerun Causes the task to be re-run even if up-to-date
Changed
- BREAKING CHANGE: Rewrite this plugin in Kotlin. (#1012)
- BREAKING CHANGE: Migrate
Transformers to using lazy properties. (#1036) - BREAKING CHANGE: Migrate
ShadowJarto using lazy properties. (#1044) - BREAKING CHANGE:
ShadowJar'sisEnableRelocationhas been renamed toenableRelocation. (#1044) - BREAKING CHANGE: Resolve
Configurationdirectly inDependencyFilter. (#1045) - BREAKING CHANGE: Migrate
SimpleRelocatorto using lazy properties. (#1047) - BREAKING CHANGE: Some public getters have been updated in
SimpleRelocator. (#1079) - BREAKING CHANGE: Migrate all
ListPropertyusages toSetProperty. (#1103)
Some publicListparameters are also changed toSet. - BREAKING CHANGE: Mark
RelocatorRemapperasinternal. (#1227) - BREAKING CHANGE: Bump min Java requirement to 11. (#1242)
- BREAKING CHANGE: Move tracking unused classes logic out of
ShadowCopyAction. (#1257) - Reduce duplicated
SimpleRelocatorto improve performance. (#1271) - BREAKING CHANGE: Move
DependencyFilterintotaskspackage. (#1272) - BREAKING CHANGE: Change the default
duplicatesStrategyfromEXCLUDEtoINCLUDE. (#1233)ShadowJarrecognizedDuplicatesStrategy.EXCLUDEas the default, but the other strategies didn't work properly.- Now
ShadowJarhonorsDuplicatesStrategy.INCLUDEas the default, and align all the strategy behaviors with the Gradle side.
- BREAKING CHANGE: Align the behavior of
ShadowTask.fromwith Gradle'sAbstractCopyTask.from. (#1233)
In the previous versions,ShadowTask.fromwould always unzip the files before processing them, which caused serial
issues that are hard to fix. Now it behaves like Gradle'sAbstractCopyTask.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:ortasks.shadowJar { from(zipTree(files('path/to/your/file.zip'))) }dependencies { implementation(files('path/to/your/file.zip')) } - BREAKING CHANGE: Rename
TransformertoResourceTransformer. (#1288)
Aims to better align with the nameorg.apache.maven.plugins.shade.resource.ResourceTransformer.java
and to distinguish itself fromorg.gradle.api.Transformer.java. - BREAKING CHANGE: Mark
DefaultInheritManifestasinternal. (#1303) - BREAKING CHANGE: Polish
ShadowSpec. (#1307)- Return values of
ShadowSpecfunctions are changed toUnitto avoid confusion. ShadowSpecno longer extendsCopySpec.- Overload
relocate,transformand things for better usability in Kotlin.
- Return values of
- BREAKING CHANGE: Remove redundant types from function returning. (#1308)
- Replace deprecated
SelfResolvingDependencywithFileCollectionDependency. (#1114) - Update start script templates. (#1183)
- Mark more
Transformers cacheable. (#1210) - Mark
ShadowJar.dependencyFilteras@Input. (#1206) - Polish
startShadowScriptstask registering. (#1216) - Refactor file visiting logic in
StreamAction, handle file unzipping viaProject.zipTree. (#1233) - Migrate doc sites to MkDocs. (#1302)
runShadowno longer depends oninstallShadowDist. (#1353)- Move the group of
ShadowJarfromshadowtobuild. (#1355) - In-development snapshots are now published to the Central Portal Snapshots repository. (#1414)
Fixed
- Fix single Log4j2Plugins.dat isn't included into fat jar. (#1039)
- Fail builds if processing bad jars. (#1146)
- Fix
Log4j2PluginsCacheFileTransformernot working for mergingLog4j2Plugins.datfiles. (#1175) - Support overriding
mainClassprovided byJavaApplication. (#1182) - Fix
ShadowJarnot being successful afterincludesorexcludesare changed. (#1200) - Honor
DuplicatesStrategy. (#1233) - Honor unzipped jars via
from. (#1233) - Fix the last modified time of shadowed directories. (#1277)
- Fix relocation exclusion for file patterns like
kotlin/kotlin.kotlin_builtins. (#1313) - Allow using file trees of JARs together with the configuration cache. (#1441)
Removed
- BREAKING CHANGE: Remove Develocity integration. (#1014)
- BREAKING CHANGE: Some public getters and setters have been removed in
SimpleRelocator. (#1079) - BREAKING CHANGE: Remove
JavaJarExec, now useJavaExecdirectly forrunShadowtask. (#1197) - BREAKING CHANGE:
ServiceFileTransformer.ServiceStreamhas been removed. (#1218) - BREAKING CHANGE: Remove
KnowsTaskas it's useless. (#1236) - BREAKING CHANGE: Remove
BaseStreamAction. (#1258) - BREAKING CHANGE: Remove
ShadowStats. (#1264) - BREAKING CHANGE: Remove
ShadowCopyAction.ArchiveFileTreeElementandRelativeArchivePath. (#1233) - BREAKING CHANGE: Remove
TransformerContext.getEntryTimestamp. (#1245) - BREAKING CHANGE: Reduce dependency and project overloads in
DependencyFilter. (#1328)
New Contributors
- @KurdTt made their first contribution in#1039
- @SimonMarquis made their first contribution in#1194
- @andsel made their first con...
Assets2
Uh oh!
There was an error while loading.Please reload this page.