-
Notifications
You must be signed in to change notification settings - Fork 1k
fix(deps): update gradle shadow packages to v9 (major) #14388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
🔧 The result from generateLicenseReport was committed to the PR branch. |
|
Even after fixing a few API changes, we still have unexpected circular dependencies, for example: This is not specific to this netty instrumentation, even when removing those "circular" dependencies in netty we get similar ones with other instrumentations. Maybe something changed in the shadowJar task dependencies resolution with the new plugin version. |
208584b to
7a4ab53
Compare
|
🔧 The result from generateLicenseReport was committed to the PR branch. |
76fc19c to
463869c
Compare
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
|
Agent jar is roughly the same size as previously, but there are a bunch of files with slight changes in size. Checked one class and got the impression that previously class constant pools was rearranged while now that class matches what is under build/classes |
trask
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @laurit!
This PR contains the following updates:
8.3.9->9.1.08.3.9->9.1.0Release 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 - At any time (no schedule defined), 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 these updates again.
This PR was generated by Mend Renovate. View the repository job log.