Skip to content

Defer dependency filter resolution to avoid breaking artifact transforms#1938

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/address-issue-882
Draft

Defer dependency filter resolution to avoid breaking artifact transforms#1938
Copilot wants to merge 2 commits intomainfrom
copilot/address-issue-882

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

shadowJar fails during task graph computation when runtimeClasspath requires artifact transforms, because AbstractDependencyFilter.resolve(Configuration) eagerly calls configuration.resolvedConfiguration.firstLevelModuleDependencies before task outputs (e.g., :lib:jar) exist.

Changes

  • DependencyFilter.kt: Wrap resolution logic in Callable so resolvedConfiguration is only accessed during task execution. Add builtBy(configuration) to preserve implicit task dependencies (producers like :lib:jar still run before shadowJar).
// Before: triggers configuration resolution at task graph computation time
return project.files(configuration.files) - excludedFiles

// After: deferred until FileCollection is iterated (execution time)
return project.files(Callable {
    // configuration.resolvedConfiguration only called here, at execution time
    configuration.files.filter { it !in excludedFiles }
}).builtBy(configuration)
  • FilteringTest.kt: Add regression test shadowJarWithArtifactTransformOnProjectDependency — multi-project build with a NoOp artifact transform on a project dependency, verifying clean shadowJar execution succeeds.

  • 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 --connect-timeout 5 REDACTED -o /dev/null (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:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…transforms

Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue related to address #882 Fix #882: Defer dependency filter resolution to avoid breaking artifact transforms Feb 27, 2026
@Goooler Goooler changed the title Fix #882: Defer dependency filter resolution to avoid breaking artifact transforms Defer dependency filter resolution to avoid breaking artifact transforms Feb 27, 2026
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.

2 participants