Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clojurephant and Gradle fail to resolve and compile transitive dependencies when using composite builds.

See original GitHub issue

Expected Behavior

I expect Gradle composite builds to capture transitive dependencies for Clojure code, transitive dependencies for Clojure to Java code, and to compile all necessary Clojure code just as it does when the composite build is not used and instead the jar is downloaded from Clojars. I expect this to work even if the artifact does not yet exist on Clojars.

Current Behavior

Gradle cannot find the transitive dependencies or compile those Clojure based transitive dependencies. Of course, this works if all the dependencies are Java based dependencies with class files inside. The problem occurs when Clojure code and Clojurephant are being used. Using AOT can partially help, but still, the project will not succeed. The example project I have attached has both Clojure and Java transitive dependencies. Using AOT I can get one level of transitive dependencies. If I specify AOT for all the dependencies, that works… except for the Java dependencies. When the Clojure code depends on Java code, the Java dependencies don’t make it to Project A from Project B. See the example project and the


I’m using composite builds to avoid publishing my projects to maven while debugging. Some of my projects are Clojure code with Gradle as the build tool. It would be exceptionally useful if I could debug a dependent project and use Gradle’s composite build feature to automatically and seamlessly include the changes before publishing those changes. Especially given the changes may be debugging code and not even potential fixes.

Steps to reproduce

I have attached two sample projects that work together using Gradle’s composite build feature. Execute ./gradlew run from project-a and observe the build fails. I would expect the build to succeed and output - among other things - “hi from b”.


Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

ajoberstarcommented, Aug 8, 2022

Glad to hear that worked for you! For future reference, I added a new doc to try to explain this.

ajoberstarcommented, Aug 12, 2022

@jzwolak Good suggestion, I’ve added a note about this to the doc

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle composite build can't resolve transitive dependencies
Isn't it supposed to be resolved as transitive dependency from project B ? Project A Compilation throws errors such as : error: package...
Read more >
Building a Composite Build (Gradle 3.1+) fails when ... - GitHub
We encountered a problem running composite builds along with dependency-management-plugin. A simple example of the problem: We have a "common" ...
Read more >
Composing builds - Gradle User Manual
Because of the reliance on dependency substitution, composite builds may force configurations to be resolved earlier, when composing the task execution ...
Read more >
Gradle Composite Build included build has the same root ...
Problem: running gradle build task from "Gradle Tab" in intellij results in an error while normal gradle invocation works fine. Expected: gradle should...
Read more >
jzwolak ( Jason Zwolak ) - github record :)
Clojurephant and Gradle fail to resolve and compile transitive dependencies when using composite builds. Thanks Andrew! The documentation you wrote looks ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found