Skip to content

Releases: GradleUp/shadow

9.4.0

15 Mar 02:04
e51f3e7

Choose a tag to compare

Added

  • Support Isolated Projects. (#1139)

Changed

  • Allow opting out of adding shadowJar into assemble lifecycle. (#1939)
    shadow {
      // Disable making `assemble` task depend on `shadowJar`. This is enabled by default.
      addShadowJarToAssembleLifecycle = false
    }
  • Stop catching ZipException when writing entries. (#1970)

Fixed

  • Fix interaction with Gradle artifact transforms. (#1345)
  • Fix skipStringConstants per-relocator behavior in mapName. (#1968)
  • Fix failing for non-existent class directories. (#1976)

9.3.2

27 Feb 12:21
929f027

Choose a tag to compare

Changed

  • Stop moving gradleApi dependency from api to compileOnly for Gradle 9.4+. (#1919)
  • Log warnings for duplicates in the final JAR. (#1931)

Fixed

  • Fix relocation patterns not included in task fingerprint. (#1933)

8.3.10

26 Feb 06:37
01e4009

Choose a tag to compare

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

  • Stop using start script templates bundled in Shadow. (#1750)
  • Update ASM and jdependency to support Java 26. (#1810)

Fixed

  • Fix resolving BOM dependencies when minimize is enabled. (#1638)
  • Use ASM from jdependency embedded. (#1898)
    This fixes potential classpath conflicts when using Shadow with other plugins that also use ASM.

9.3.1

06 Jan 06:01
312d8f9

Choose a tag to compare

Fixed

  • Use ASM from jdependency embedded. (#1898)
    This fixes potential classpath conflicts when using Shadow with other plugins that also use ASM.

9.3.0

05 Dec 15:55
9.3.0
bfc351e

Choose a tag to compare

Added

  • Add PatternFilterableResourceTransformer to simplify pattern based ResourceTransformers. (#1849)
  • Expose patternSet of ServiceFileTransformer as public. (#1849)
  • Expose patternSet of ApacheLicenseResourceTransformer as public. (#1850)
  • Expose patternSet of ApacheNoticeResourceTransformer as public. (#1850)
  • Expose patternSet of PreserveFirstFoundResourceTransformer as public. (#1855)
  • Support overriding output path of ApacheNoticeResourceTransformer. (#1851)
  • Add new merge strategy Fail to PropertiesFileTransformer. (#1856)
  • Add FindResourceInClasspath task to help with debugging issues with merged duplicate resources. (#1860)
  • Add MergeLicenseResourceTransformer. (#1858)
  • Add DeduplicatingResourceTransformer to deduplicate on path and content. (#1859)
  • Support disabling Kotlin module metadata remapping. (#1875)
    tasks.shadowJar {
      // Disable remapping of Kotlin module metadata (`.kotlin_module`) files. This is enabled by default.
      enableKotlinModuleRemapping = false
    }

Changed

  • Change the group of startShadowScripts from application to other. (#1797)
  • Update ASM and jdependency to support Java 26. (#1799)
  • Bump min Gradle requirement to 9.0.0. (#1801)
  • Deprecate PreserveFirstFoundResourceTransformer.resources. (#1855)
  • Make the output of PropertiesFileTransformer reproducible. (#1861)
  • Deprecate ShadowCopyAction. (#1876)
    It should not be used as a public API. Will be made internal in a future release.

Fixed

  • Fix Develocity integration when Isolated Projects enabled. (#1836)

9.2.2

26 Sep 09:29
1245cda

Choose a tag to compare

Fixed

  • Fix the regression of registering ShadowJar tasks without ShadowPlugin applied. (#1787)

9.2.1

24 Sep 07:04
75e4e0f

Choose a tag to compare

Added

  • Support relocating Groovy extensions in Module descriptors. (#1705)
  • Add extensions for Iterable<Relocator>. (#1710)
  • Support relocating list of types in RelocatorRemapper. (#1714)
  • Add mainClass property into ShadowJar. (#1722)
    tasks.shadowJar {
      // This property will be used as a fallback if there is no explicit `Main-Class` attribute set.
      mainClass = "my.Main"
    }
  • Honor executableDir and applicationName in application extension. (#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 in KotlinModuleMetadata but KmModule.optionalAnnotationClasses due to very limited usage of it. See more discussion here.
  • Allow overriding BUNDLING_ATTRIBUTE in GMM. (#1773)
    The org.gradle.dependency.bundling in shadowed JAR's Gradle Module Metadata is set to shadowed by default. You can override it for now by:
    shadow {
      bundlingAttribute = Bundling.EMBEDDED
    }

Changed

  • Merge Groovy Module descriptors into the modern META-INF path. (#1706)
    The Gradle Module descriptors (org.codehaus.groovy.runtime.ExtensionModule files) defined under META-INF/services/
    and META-INF/groovy will be merged into META-INF/groovy/org.codehaus.groovy.runtime.ExtensionModule.
  • Move injecting Class-Path manifest attr logic from doFirst into copy. (#1720)
  • Move injecting Main-Class manifest attr logic from doFirst into copy. (#1724)
  • Deprecate InheritManifest and inheritFrom. (#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 JavaExec error message when main class is not set. (#1725)
  • Update RelocatorRemapper class 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)

9.1.0

29 Aug 09:49
6e3497d

Choose a tag to compare

Added

  • Allow opting out of shadowRuntimeElements variant. (#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()
    }
  • 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-Release attribute. (#1675)
    tasks.shadowJar {
      // Disable adding `Multi-Release` attribute into the manifest of the shadowed jar.
      addMultiReleaseAttribute = false
    }

Changed

  • Don't inject TargetJvmVersion attribute when automatic JVM targeting is disabled. (#1666)
  • Do not write modified class files for no-op relocations. (#1694)
  • BREAKING CHANGE: The introduction of some afterEvaluate usages may cause configuration issues in rare cases.

9.0.2

15 Aug 03:45
b7e1818

Choose a tag to compare

Fixed

  • Fix missing space in ApacheNoticeResourceTransformer preamble causing malformed NOTICE header. (#1623)
  • Fix using ApacheNoticeResourceTransformer without projectName. (#1627)
  • Fix extra indents of ApacheNoticeResourceTransformer output. (#1628)
  • Fix resolving BOM dependencies when minimize is enabled. (#1637)

9.0.1

09 Aug 10:01
9b51f5f

Choose a tag to compare

Note

If you are upgrading from 8.x versions, please read 9.0.0 release notes first.

Tip

You can diff the shadowed JARs when upgrading from 8.x to 9.x by using Diffuse.
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 duplicatesStrategy back to EXCLUDE. (#1617)
    • This strategy is consistent with 8.x series behavior, which is more compatible for most users upgrading.
    • For most ResourceTransformer users, you need to override the strategy to INCLUDE to make them work.
    • Strongly suggest declaring the duplicatesStrategy explicitly in your ShadowJar configuration to avoid confusion.
    • See more details about the strategies at Handling Duplicates Strategy.

Fixed

  • Fix the regression of can't shadow directory inputs. (#1606)
  • Fix the regression of MinimizeDependencyFilter. (#1611)