Not able to resolve dependency across Multiple Gradle Projects

Hi Team,

I have created 2 separate Gradle projects

  1. Project_A ( - Library, without main.
  2. Project_B ( - A SpringBoot application.

I want to add Project_A as a dependency of Project_B.

I have tried ‘maven-publish’ plugin on Project_A to publish to maven-local, and use mavenLocal() to pull dependencies in Project_B, but it didn’t work.

I have also tried adding my library as dependency like:
implementation project(‘:my_lib:0.0.1’)
implementation ‘’

But I keep getting error: Could not find…

Need help in resolving dependencies across multiple projects.

You should be very careful when using mavenLocal().
It is broken by design and I’d recommend to avoid it whenever you can.
If you really need to publish-then-consume with local projects, better use some other directory as local file repository.

implementation project(‘:my_lib:0.0.1’) only works for projects within the same multi-project build, not with published libraries. implementation ‘’ should have worked if that actually was what you published. Check Maven Local directory what got published there and / or the result of ./gradlew outgoingVariants in Project_A.

Actually, if the Gradle version in A and B are compatible I’d usually rather prefer using composite build feature to combine the builds, then everything is built as needed automatically and you can also work on both together in one IDE, and not have to have two projects open and remember to publish in-between and so on.