When a dependency on proj1 is declared in proj2, proj1 brings along its declared dependencies, not its resolved dependency artifacts. The resulting dependency tree is then resolved in the context of proj2. If proj2 does not define a repository that can also resolve proj1’s dependencies, then dependency resolution fails.
If you share the flat repository between both projects by declaring it in both projects, then the dependencies should resolve.
For example, if the libs directory was in the root project directory, then you could define the repository in the same manner in both proj1 and proj2 as:
repositories {
flatDir {
dir rootProject.file( 'libs' )
}
}
Thank you, that fixes this issue. But I have two concerns.
The biggest concern is that there are also proj3, proj4 and other projects that depend on proj1. So this solution looks not very scalable.
Another concern is that I have to insert this repositories block in the projects that don’t use this lombok-edge dependency. That looks weird to me. Why shoud I have to declare dependency in the build script if I don’t use it?
maybe you just need to make lombok dependency compileOnly so it would not be inherited by other projects depending on proj1 via trasitive dependencies
didn’t try it though