testRuntime Dependency Missing

I’m getting errors in my unit tests because the javax.servlet.* classes can’t be found. For example, “java.lang.ClassNotFoundException: javax.servlet.ServletOutputStream” as well as many others.

I specifically added the following to the build.gradle file:

testRuntime (
     'javax.servlet:servlet-api:2.4'
    )

Yet when I run “gradle dependencies”, the dependency graph does not show servlet-api under the testRuntime dependencies.

I’m at a complete loss as to what could be causing this and where to even start investigating. Gradle version info:

$ gradle --version ------------------------------------------------------------ Gradle 1.10 ------------------------------------------------------------

Build time:

2013-12-17 09:28:15 UTC Build number: none Revision:

36ced393628875ff15575fa03d16c1349ffe8bb6

Groovy:

1.8.6 Ant:

Apache Ant™ version 1.9.2 compiled on July 8 2013 Ivy:

2.2.0 JVM:

1.7.0_21 (Oracle Corporation 23.21-b01) OS:

Windows XP 5.2 amd64

Try running the build with --debug and look for anything related to servlet-api