I'm using gradle to build a groovy/java application. This worked fine until I added a dependency to google guice 3.0. Gradle does not add the guice jars to the compilation classpath, at least it seems so. I get errors like these:
C:\dev\workspaces\initial>gradle -q compileJava C:\dev\workspaces\initial\src\main\java\com\comp\test\solmon\di\GuiceDI.java:3: package com.google.inject does not exist import com.google.inject.Guice; ^ C:\dev\workspaces\initial\src\main\java\com\comp\test\solmon\di\GuiceDI.java:4: package com.google.inject does not exist import com.google.inject.Injector; In my build.gradle file I have the following dependencies:
dependencies{ runtime 'com.beust:jcommander:1.27' runtime "org.slf4j:slf4j-api:1.7.1" runtime "ch.qos.logback:logback-classic:1.0.7" runtime 'com.google.inject:guice:3.0' testRuntime 'junit:junit:4+' } I'm developing the application in Springsource Tool Suite 2.9.2 with its gradle plugin and it uses gradles dependency management to get all dependencies. Sts manages to compile the code just fine, it's only gradle that fails. I've tried to run the gradle compilation with the "--debug" parameter but I can not see which classpath gradle gives to the compiler.
Any ideas how to get gradle to compile my application?