Stated project dependency missing in classpath


(Blair Butterworth) #1

I have a project (with the following dependencies.

dependencies {
 compile project(':src:common:ui')
 compile project(':src:common:services')
  compile project(':src:common:commands')
 compile project(':src:common:commands:ui')
 ... (more)
}

Executing the dependencies task outputs the following.

compile - Compile classpath for source set 'main'.
+--- project :src:common:ui
+--- project :src:common:services
+--- project :src:common:commands
+--- project :src:common:commands:ui -> project :src:common:ui
... (more)

With the following classpath (configurations.compile.asPath).

D:\build\-src-common-ui\libs\hub.common.ui.jar;D:\build\-src-common-services\libs\hub.common.services.jar;D:\build\-src-common-commands\libs\hub.common.commands.jar;(...more)

Executing compile fails with errors indicating classes provided by :src:common:commands:ui are missing. This is confirmed when interogating the classpath of the configuration which is missing the :src:common:commands:ui jar. This happens in a number of my projects.

In the dependency output what does the arrow “->” signify and why has my dependency been omitted?


(René Groeschke) #2

I think the problem is that you have two dependencies on a project called “ui” (src:common:ui and src:common:commands:ui). Do these projects have the same Group/Name/Version combination.

If this is the case, I guess the project dependency on src:common:commands:ui with a transitive dependency on src:common:ui (that what the -> indicates) is skipped in favour of the src:common:ui project.

Can you make the group/name/version combination unique for both projects and check again?


(Peter Niederwieser) #3

Looks like a recent bug to me. Can you try with latest nightly (http://www.gradle.org/nightly)?


(Blair Butterworth) #4

Providing unique project names fixed the issue. Many thanks.