Gradle multi-project build dependency resolution
I have a pretty simple gradle multi-project build like so:
projA --
projB
--build.gradle
projC
--build.gradle
build.gradle
So in the build.gradle for projA I have something like:
allprojects {
...
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.+'
testCompile group: 'org.mockito', name: 'mockito-core', version: '1.9.0'
}
}
When I create the IDEA project files from the gradle files, the dependencies specified in allprojects are not available to the child projects, only to the top level project, so nothing compiles in the sub projects. It works as expected if I run Gradle from the command line.
Have I missed something? I am using IDEA 11.01
Cheers, Ben
请先登录再写评论。
Hi Ben,
We use gradle api and it looks like it works incorrectly at this situation - GRADLE-2008.
Denis
Thanks Denis
I have worked around this for now by using the eclipse plugin, importing the eclipse project and linking my dependencies to the eclipse .classpath file for regeneration.
A bit nasty but it works!
Cheers, Ben
Hi,
I'll check how that situation is handled by gradle eclipse api, thanks.
Denis
Hello,
It's strange that eclipse supports that as I've just checked how it works at the eclipse gradle api level and got the same exception.
Btw, I've created dedicated ticket for that at the gradle tracker - GRADLE-2049.
Denis
Hi,
Gradle guys have answered - the build config is incorrect.
Please check the comments at the GRADLE-2049.
Denis