Simple Gradle, Java, Jersey web service dependency issue

I am trying a super simple web services test project with Gradle.

I have a trivial test class that does this:

import com.sun.jersey.test.framework.JerseyTest;

this import fails at testCompile time with the error:

package com.sun.jersey.test.framework does not exist

my build.gradle is very simple:

apply plugin: 'java'
  repositories {
  dependencies {
 compile 'com.sun.jersey:jersey-core:1.12'
 compile 'com.sun.jersey:jersey-server:1.12'
 compile 'com.sun.jersey:jersey-grizzly2:1.12'
   testCompile 'com.sun.jersey:jersey-test-framework:1.12'

If enable info output (gradle --info --refresh-dependencies clean compileTest), I see:

Cached resource is up-to-date (lastModified: Wed Feb 15 10:55:30 CST 2012). [HTTP:]
Resource missing. [HTTP HEAD:]

There are no .jar files in

If I look at, it just seems to refererence seven sub-projects. Those sub-projects, such as jersey-test-framework-core, have the jars. For example, I can see jar files in here:

First, that directory path looks suspicious. Shouldn’t the URL be instead of

Secondly, shouldn’t Gradle try to get these dependencies and give me an error related to that?

Thanks for any help!

The modules element in a Maven POM is a compile-time construct. It has no effect on transitive dependency resolution, neither in Gradle nor in Maven. Unless Jersey provides an aggregate POM that lists those modules as dependencies, you’ll have to explicitly list the required modules in your Gradle build script.