chore(deps): update plugin com.gradleup.shadow to v9 #1150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



This PR contains the following updates:
8.3.9->9.2.2Release Notes
GradleUp/shadow (com.gradleup.shadow)
v9.2.2Compare Source
Fixed
ShadowJartasks withoutShadowPluginapplied. (#1787)v9.2.1Compare Source
Added
Iterable<Relocator>. (#1710)RelocatorRemapper. (#1714)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" }executableDirandapplicationNameinapplicationextension. (#1740)This is useful when you want to customize the output directory of the start scripts and the application distribution.
ShadowApplicationPlugin.Companion. (#1771)The current implementation relocates all properties in
KotlinModuleMetadatabutKmModule.optionalAnnotationClassesdue to very limited usage of it. See more discussion here.
BUNDLING_ATTRIBUTEin GMM. (#1773)The
org.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
META-INFpath. (#1706)The Gradle Module descriptors (
org.codehaus.groovy.runtime.ExtensionModulefiles) defined underMETA-INF/services/and
META-INF/groovywill be merged intoMETA-INF/groovy/org.codehaus.groovy.runtime.ExtensionModule.Class-Pathmanifest attr logic fromdoFirstintocopy. (#1720)Main-Classmanifest attr logic fromdoFirstintocopy. (#1724)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. }JavaExecerror message when main class is not set. (#1725)RelocatorRemapperclass pattern to cover more Java method descriptors. (#1731)Fixed
+. (#1597)v9.2.0Compare Source
v9.1.0Compare Source
Added
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"] as AdhocComponentWithVariants javaComponent.withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) { // See more details in https://github.com/GradleUp/shadow/pull/1662. skip() }TARGET_JVM_VERSION_ATTRIBUTE. (#1674)shadow { // Disable adding `TargetJvmVersion` attribute into the Gradle Module Metadata of the shadowed jar. addTargetJvmVersionAttribute = false }Multi-Releaseattribute. (#1675)tasks.shadowJar { // Disable adding `Multi-Release` attribute into the manifest of the shadowed jar. addMultiReleaseAttribute = false }Changed
TargetJvmVersionattribute when automatic JVM targeting is disabled. (#1666)afterEvaluateusages may cause configuration issues in rare cases.v9.0.2Compare Source
Fixed
ApacheNoticeResourceTransformerpreamble causing malformed NOTICE header. (#1623)ApacheNoticeResourceTransformerwithoutprojectName. (#1627)ApacheNoticeResourceTransformeroutput. (#1628)minimizeis enabled. (#1637)v9.0.1Compare Source
Changed
mainClassName. (#1601)duplicatesStrategyback toEXCLUDE. (#1617)ResourceTransformerusers, you need to override the strategy toINCLUDEto make them work.duplicatesStrategyexplicitly in yourShadowJarconfiguration to avoid confusion.Fixed
MinimizeDependencyFilter. (#1611)v9.0.0Compare Source
Added
SimpleRelocatorchanges from maven-shade-plugin. (#1076)separatorinAppendingTransformer. (#1169)This is useful for handling files like
resources/application.yml.module-info.classin Multi-Release folders by default. (#1177)TargetJvmVersionattribute for Gradle Module Metadata. (#1199)ShadowApplicationPluginwithApplicationPlugin. (#1224)Multi-Releasemanifest attribute if any dependency contains it. (#1239)Transformeras throwingIOException. (#1248)SimpleRelocatorto improve performance. (#1271)ShadowJar.dependencies. (#1322)ShadowJar. (#1365)assembledepend onshadowJar. (#1524)PreserveFirstFoundResourceTransformer. (#1548)This is useful when you set
shadowJar.duplicatesStrategy = DuplicatesStrategy.INCLUDEandwant to ensure that only the first found resource is included in the final JAR.
This feature is controlled by the
shadowJar.failOnDuplicateEntriesproperty, which isfalseby default.Related to setting
duplicatesStrategy = DuplicatesStrategy.FAILbut there are some differences:duplicatesStrategyto any value.Changed
Transformers to using lazy properties. (#1036)ShadowJarto using lazy properties. (#1044)Configurationdirectly inDependencyFilter. (#1045)SimpleRelocatorto using lazy properties. (#1047)SimpleRelocator. (#1079)ListPropertyusages toSetProperty. (#1103)Some public
Listparameters are also changed toSet.RelocatorRemapperasinternal. (#1227)ShadowCopyAction. (#1257)DependencyFilterintotaskspackage. (#1272)duplicatesStrategyfromEXCLUDEtoINCLUDE. (#1233)ShadowJarrecognizedEXCLUDEas the default, but the other strategies didn't work properly.ShadowJarhonorsINCLUDEas the default, and aligns all the strategy behaviors with the Gradle side.ResourceTransformers (e.g.ServiceFileTransformer) do not work withEXCLUDE, as it will exclude duplicate resources to be merged.PreserveFirstFoundResourceTransformer.filesMatchingto override the default strategy for specific files.failOnDuplicateEntries = trueto fail the build to check for duplicate entries.duplicatesStrategyis changed back toEXCLUDEin 9.0.1 release.ShadowTask.fromwith Gradle'sAbstractCopyTask.from. (#1233)In the previous versions,
ShadowTask.fromwould always unzip the files before processing them, which caused serialissues that are hard to fix. Now it behaves like Gradle's
AbstractCopyTask.from, which means it will not unzipthe files, only copy the files as-is. If you still want to shadow the unzipped files, try out something like:
tasks.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')) }TransformertoResourceTransformer. (#1288)Aims to better align with the name
org.apache.maven.plugins.shade.resource.ResourceTransformer.javaand to distinguish itself from
org.gradle.api.Transformer.java.DefaultInheritManifestasinternal. (#1303)ShadowSpec. (#1307)ShadowSpecfunctions are changed toUnitto avoid confusion.ShadowSpecno longer extendsCopySpec.relocate,transformand things for better usability in Kotlin.ShadowJar'sisEnableRelocationtoenableAutoRelocation. (#1541)ShadowBasePluginandShadowJavaPluginare moved. (#1589)You can find them in
ShadowJar,ShadowApplicationPlugin, andShadowJavaPlugin.SelfResolvingDependencywithFileCollectionDependency. (#1114)Transformers cacheable. (#1210)ShadowJar.dependencyFilteras@Input. (#1206)startShadowScriptstask registering. (#1216)StreamAction, handle file unzipping viaProject.zipTree. (#1233)runShadowno longer depends oninstallShadowDist. (#1353)ShadowJarfromshadowtobuild. (#1355)AbstractDependencyFilterfrominternaltopublic. (#1538)You can access it via
com.github.jengelman.gradle.plugins.shadow.tasks.DependencyFilter.AbstractDependencyFilter.Actionparameters as non-null. (#1555)BufferedOutputStreamwhen writing the Zip file to improve performance. (#1580)Fixed
Log4j2PluginsCacheFileTransformernot working for mergingLog4j2Plugins.datfiles. (#1175)mainClassprovided byJavaApplication. (#1182)ShadowJarnot being successful afterincludesorexcludesare changed. (#1200)DuplicatesStrategy. (#1233)from. (#1233)kotlin/kotlin.kotlin_builtins. (#1313)Removed
SimpleRelocator. (#1079)JavaJarExec, now useJavaExecdirectly forrunShadowtask. (#1197)ServiceFileTransformer.ServiceStreamhas been removed. (#1218)KnowsTaskas it's useless. (#1236)BaseStreamAction. (#1258)ShadowStats. (#1264)ShadowCopyAction.ArchiveFileTreeElementandRelativeArchivePath. (#1233)TransformerContext.getEntryTimestamp. (#1245)DependencyFilter. (#1328)ShadowSpec. (#1560)Relocator.ROLE. (#1563)ShadowExtension.component. (#1586)Migration Example
8.x
tasks.shadowJar { isEnableRelocation = true duplicatesStrategy = DuplicatesStrategy.EXCLUDE mergeServiceFiles() from("foo.jar") }9.x
tasks.shadowJar { // `isEnableRelocation` has been renamed to `enableAutoRelocation`. enableAutoRelocation = true // If you want to make `mergeServiceFiles` or most resource transformers work, you should set the `duplicatesStrategy` to `INCLUDE`. // Because `EXCLUDE` will exclude extra service files to be merged. duplicatesStrategy = DuplicatesStrategy.INCLUDE mergeServiceFiles() // Optionally, you can enable the new `failOnDuplicateEntries` property to fail the build if there are duplicate entries. failOnDuplicateEntries = true // If you want to keep the `foo.jar` as-is (zipped), you can use the `from` method directly. This is different from the previous. from("foo.jar") // If you want to unzip the `foo.jar` before processing, you can use `zipTree` to unzip it. from(zipTree("foo.jar")) }If you used Shadow for merging service files, the following steps are recommended:
duplicatesStrategyasINCLUDEorWARN.mergeServiceFilesorServiceFileTransformerstuff as you did in your previous setup.INCLUDEbyeachFile,filesMatching, orPreserveFirstFoundResourceTransformer.failOnDuplicateEntries.This can also ensure the regressions are caught in the future.
See more details about the fixed
DuplicatesStrategybehaviors at Handling Duplicates Strategy.New Contributors
Full Changelog: GradleUp/shadow@8.3.9...9.0.0
Configuration
📅 Schedule: Branch creation - "every weekend" in timezone Europe/Prague, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.