It’s really strange that the guice-3.0.jar wasn’t included in the war file. I confirmed that I included this in build.gradle: compile ‘com.google.inject:guice:3.0’
Gradle looks good, but when using, a lot of problems. For example, doesn’t support GWT well, need to find my own solution. IDEA doesn’t support it well, especially for web applications. It seems that I have to give up gradle and go back to Maven which seems much maturer.
If Guice wasn’t included in the War, there is very likely a good reason for it. For example, maybe Guice was also a transitive ‘providedCompile’ dependency. In any case, we’d have to see a concrete example.
Regarding IntelliJ support, I recommend to check out IntelliJ 13 (EAP), which already has much better Gradle support than IntelliJ 12. I’m sure the folks at JetBrains would also be interested in getting feedback on what’s still missing.
As a new user from Maven, I spent a lot of time to investigate Gradle issues. I like the idea, but realised that may need to wait until it’s stronger in many detailed aspects.
Another typical issue I’m encountering is that, gradle always conflicts with the existing local Maven repository. I have to delete each one from Maven repo manually, and then run the gradle command again. I could rm -rf ~/.m2, but it will take long time to download all dependencies again.
Gradle doesn’t use the local Maven repo, except when it’s explicitly told to do so. The only reason to do that is for exchanging artifacts with Maven builds (otherwise it’s better not to declare the local Maven repo). Recent Gradle versions have improved interoperability with the local Maven repo, and it should no longer be necessary to delete it.
The War plugin adds two dependency configurations: providedCompile and providedRuntime. Those configurations have the same scope as the respective compile and runtime configurations, except that they are not added to the WAR archive. It is important to note that those provided configurations work transitively. Let's say you add commons-httpclient:commons-httpclient:3.0 to any of the provided configurations. This dependency has a dependency on commons-codec. This means neither httpclient nor commons-codec is added to your WAR, even if commons-codec were an explicit dependency of your compile configuration. If you don't want this transitive behavior, simply declare your provided dependencies like commons-httpclient:commons-httpclient:3.0@jar.
Sometimes this seems confusing as ‘commons-codec’ is an explicit dependency but still not added to WAR.