Dependency Resolution Fails in Gradle 6

I’ve got 2 problems since upgrading to Gradle 6. I’ve got a multi-project build. As part of the upgrade process to Gradle 6, I replaced all of my “compile” dependencies with “implementation” as per the documentation. However, when I do so, if I have a project that depends on another project A depends on B, then the dependencies of B are not available in A as transitive dependendencies leading to compilation errors. I can run >gradle dependencies, and it will show the project but not it’s transitive dependencies. According to how I interpreted the documentation the dependencies should have been resolved. I’ve had to revert back to “compile” for this scenario.

My other problem is that now I’m getting build failures with a “The last tag is not a semantic version.” message. The message does not tell me which dependency even if I do a full stack trace. I can usually get the error to disappear if I run >gradle dependencies on the parent and dependent projects but I should not have to do this. Here is a link to the build scan with the dependency resolution problem:

and here is a link to the scan with the “implementation” transitive dependency problem:

Hi @xpress495,

If the dependencies are required transitively at compile time, you need to declare them as api instead of implementation. See also: Recognizing API and implementation dependencies.

Make sure that you apply the java-library plugin to all your projects (instead of the java plugin). It should make no difference to your build apart from making api available.

“The last tag is not a semantic version” error originates from the ‘io.wusa.semver-git-plugin’ plugin. So I can’t really tell what is going on there. Do you have specific dependency declarations in your build that use functionality from that plugin? If the error persists, maybe you can share that part of your build script.

PS: Thanks for providing build scans. Makes it much easier to provide help.


Thank you for the reply. After a lot of trial and error (since I had so many sub-projects), I was able to sort through the dependency jungle. Also, I found the cause of the semantic version error: One of my projects was incorrectly tagged. Gets complicated fast when you have so many interdependent projects.


1 Like