Skip to content

Allow opting out of adding shadowJar into assemble lifecycle#1939

Merged
Goooler merged 5 commits intomainfrom
copilot/fix-issue-1908
Mar 1, 2026
Merged

Allow opting out of adding shadowJar into assemble lifecycle#1939
Goooler merged 5 commits intomainfrom
copilot/fix-issue-1908

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 1, 2026

Since #1766, shadowJar is unconditionally wired to assemble. Users who rely on assemble as a fast feedback cycle (compile + standard jar) and only build shadow jars on demand have no way to opt out.

Changes

  • ShadowExtension: New addShadowJarToAssembleLifecycle: Property<Boolean> property (defaults true — fully backward compatible)
  • ShadowBasePlugin: Sets convention to true
  • ShadowJar.registerShadowJarCommon: Checks shadow.addShadowJarToAssembleLifecycle.get() inside configureEach (lazy, evaluated after project configuration) before calling dependsOn
  • shadow.api: Updated ABI dump

Usage

shadow {
  addShadowJarToAssembleLifecycle = false
}

With this set, ./gradlew assemble skips shadowJar; ./gradlew shadowJar still works explicitly.


  • CHANGELOG's "Unreleased" section has been updated, if applicable.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xmx4g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)
    • Triggering command: /usr/bin/curl curl -s --max-time 5 REDACTED (dns block)
    • Triggering command: /usr/bin/curl curl -s --max-time 10 REDACTED (dns block)
  • scans-in.gradle.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xmx4g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue #1908 Fix #1908: Add addShadowJarToAssembleLifecycle option to ShadowExtension Mar 1, 2026
@Goooler Goooler linked an issue Mar 1, 2026 that may be closed by this pull request
@Goooler Goooler requested a review from Copilot March 1, 2026 11:56
@Goooler Goooler marked this pull request as ready for review March 1, 2026 11:59

This comment was marked as outdated.

@Goooler Goooler changed the title Fix #1908: Add addShadowJarToAssembleLifecycle option to ShadowExtension Allow opting out of adding shadowJar into assemble lifecycle Mar 1, 2026
@Goooler Goooler enabled auto-merge (squash) March 1, 2026 12:03
@Goooler Goooler merged commit 8da1578 into main Mar 1, 2026
12 checks passed
@Goooler Goooler deleted the copilot/fix-issue-1908 branch March 1, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide an option to not add 'shadowJar' task to 'assemble' lifecycle

3 participants