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 the new doc site before upgrading.
BREAKING
- Rewrite this plugin in Kotlin. (#1012)
Some APIs are marked asinternal
, and there are serial ABI changes. - Remove Develocity integration. (#1014)
- Migrate
Transformer
s to using lazy properties. (#1036) - Migrate
ShadowJar
to using lazy properties.isEnableRelocation
is removed, useenableRelocation
instead. (#1044) - Resolve
Configuration
directly inDependencyFilter
. (#1045) - Some public getters are removed from
SimpleRelocator
,includes
andexcludes
are exposed asSetProperty
s. (#1079) - Migrate all
ListProperty
usages toSetProperty
. Some publicList
parameters are also changed toSet
. (#1103) - Remove
JavaJarExec
, now useJavaExec
directly forrunShadow
task. (#1197) ServiceFileTransformer.ServiceStream
has been removed. (#1218)- Mark
RelocatorRemapper
asinternal
. (#1227) - Remove
KnowsTask
as it's useless. (#1236) - Remove
TransformerContext.getEntryTimestamp
. (#1245) - Move tracking unused classes logic out of
ShadowCopyAction
. (#1257) - Remove
BaseStreamAction
. (#1258) - Remove
ShadowStats
. (#1264) - Move
DependencyFilter
fromcom.github.jengelman.gradle.plugins.shadow.internal
intocom.github.jengelman.gradle.plugins.shadow.tasks
. (#1272) - Rename
Transformer
toResourceTransformer
. Aims to better align with the name oforg.apache.maven.plugins.shade.resource.ResourceTransformer.java
and to distinguish itself fromorg.gradle.api.Transformer.java
. (#1288) - Mark
DefaultInheritManifest
asinternal
. (#1303) - Polish
ShadowSpec
. Return values ofShadowSpec
functions are changed toUnit
to avoid confusion.ShadowSpec
no longer extendsCopySpec
. Overloadrelocate
,transform
and things for better usability in Kotlin. (#1307) - Remove redundant types from function returning. (#1308)
- Reduce dependency and project overloads in
DependencyFilter
. (#1328) - Align the behavior of
ShadowTask.from
with Gradle'sAbstractCopyTask.from
. 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'sAbstractCopyTask.from
, which means it will not unzip the files, only copy the files as-is. (#1233) - Remove
ShadowCopyAction.ArchiveFileTreeElement
andRelativeArchivePath
. (#1233)
Added
- Add .md support to the Apache License and Notice transformers. (#1041)
- Sync
SimpleRelocator
changes from maven-shade-plugin. (#1076) - Exclude
module-info.class
in Multi-Release folders by default. (#1177) - Inject
TargetJvmVersion
attribute for Gradle Module Metadata. (#1199) - Support Java 24. (#1222)
- Sync
ShadowApplicationPlugin
withApplicationPlugin
. (#1224) - Inject
Multi-Release
manifest attribute if any dependency contains it. (#1239) - Mark
Transformer
as throwingIOException
. (#1248) - Compat Kotlin Multiplatform plugin. You still need to manually configure
manifest.attributes
(e.g.Main-Class
attr) in theshadowJar
task if necessary. (#1280) - Add Kotlin DSL examples in docs. (#1306)
- Support using type-safe dependency accessors in
ShadowJar.dependencies
. (#1322) - Set
Main-Class
attr for KMP 2.1.0 or above. (#1337) - Support command line options for
ShadowJar
. (#1365)
Changed
- Exclude kotlin-stdlib from plugin dependencies. (#1093)
- Replace deprecated
SelfResolvingDependency
withFileCollectionDependency
. (#1114) - Support configuring
separator
inAppendingTransformer
. This is useful for handling files likeresources/application.yml
. (#1169) - Update start script templates. (#1183) (#1419)
- Mark
ShadowJar.dependencyFilter
as@Input
.ShadowSpec.stats
is removed andShadowJar.stats
isinternal
for now. (#1206) - Mark more
Transformer
s cacheable. (#1210) - Polish
startShadowScripts
task registering. (#1216) - Bump min Java requirement to 11. (#1242)
- Reduce duplicated
SimpleRelocator
to improve performance. (#1271) - Migrate doc sites to MkDocs. (#1302)
runShadow
no longer depends oninstallShadowDist
. (#1353)- Move the group of
ShadowJar
fromshadow
tobuild
. (#1355) - Set
Main-Class
attr for KMP 1.9.0 or above. (#1410) - In-development snapshots are now published to the Central Portal Snapshots repository at https://central.sonatype.com/repository/maven-snapshots/. (#1414)
- Update ASM to 9.8 to support Java 25. (#1380)
- Refactor file visiting logic in
StreamAction
, handle file unzipping viaProject.zipTree
. (#1233) - Don't re-add suppressed Gradle API to
compileOnly
configuration. (#1422) - Bump the min Gradle requirement to 8.11. (#1479)
- Expose Ant as
compile
scope. (#1488)
Fixed
- Fix single Log4j2Plugins.dat isn't included into fat jar. (#1039)
- Adjust property initializations and modifiers in
ShadowJar
. This fixes the regression for registering customShadowJar
tasks. (#1090) - Fail builds if processing bad jars. (#1146)
- Fix
Log4j2PluginsCacheFileTransformer
not working for mergingLog4j2Plugins.dat
files. (#1175) - Support overriding
mainClass
provided byJavaApplication
. (#1182) - Fix
ShadowJar
not being successful afterincludes
orexcludes
are changed. (#1200) - Fix the last modified time of shadowed directories. (#1277)
- Fix relocation exclusion for file patterns like
kotlin/kotlin.kotlin_builtins
. (#1313) - Avoid creating jvm targets eagerly for KMP. (#1378)
- Allow using file trees of JARs together with the configuration cache. (#1441)
- Fallback
RelocateClassContext
andRelocatePathContext
to data classes. (#1445) - Pin the plugin's Kotlin language level on 2.0. The language level used in
9.0.0-beta14
is 2.2, which may cause compatibility issues for the plugins depending on Shadow. (#1448) - Fix compatibility for Gradle 9.0.0 RC1. (#1468)
- Honor
DuplicatesStrategy
. Shadow recognizedDuplicatesStrategy.EXCLUDE
as the default, but the other strategies didn't work properly. Now we honorDuplicatesStrategy.INCLUDE
as the default, and align all the strategy behaviors with the Gradle side. (#1233) - Honor unzipped jars via
from
. (#1233)
New Contributors
- @KurdTt made their first contribution in #1039
- @SimonMarquis made their first contribution in #1194
- @andsel made their first contribution in #1241
- @vlsi made their first contribution in #1490
- @Jonathing made their first contribution in #1422
Full Changelog: 8.3.8...9.0.0-rc1