Update dependency com.gradleup.shadow:shadow-gradle-plugin to v9 #3281
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.1.0Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
GradleUp/shadow (com.gradleup.shadow:shadow-gradle-plugin)
v9.1.0Compare Source
Added
shadowRuntimeElementsvariant. (#1662)TARGET_JVM_VERSION_ATTRIBUTE. (#1674)Multi-Releaseattribute. (#1675)Changed
TargetJvmVersionattribute when automatic JVM targeting is disabled. (#1666)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` work, should set the `duplicatesStrategy` as `INCLUDE`. // `EXCLUDE` will exclude extra service files to be merged. duplicatesStrategy = DuplicatesStrategy.INCLUDE mergeServiceFiles() // If you leave `duplicatesStrategy` as `INCLUDE`, you can use the new `PreserveFirstFoundResourceTransformer` // to ensure that only the first found resource is included in the final JAR. Or duplicate entries will be bundled. transform<PreserveFirstFoundResourceTransformer>() { resources.add("META-INF/some-resource.txt") } // 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.INCLUDEbyfilesMatchingorPreserveFirstFoundResourceTransformer.failOnDuplicateEntries.New Contributors
Full Changelog: GradleUp/shadow@8.3.9...9.0.0
Configuration
📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ 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.