Dependencies missing from configurations - what am I doing wrong?

The Java plugin seems to be leaving out a few dependencies from various configurations. I first noticed this in a real project when my fatjar was missing some libraries but I can reproduce the problem in a new, empty directory.

Here are the full contents of my build.gradle:

apply plugin: "java" 

repositories {

dependencies {
    compile 'org.apache.httpcomponents:httpcomponents-client:4.5',

    testCompile 'junit:junit:4.10',

println("compile dependencies:")
configurations.compile.each {
println("testCompile dependencies:")
configurations.testCompile.each {

And here is the relevant command line output (slighty massaged for readability):

MacBook-Pro:temp $ gradle clean

compile dependencies:

testCompile dependencies:

I would expect httpcomponents client and core to appear in the compile configuration and powermock to appear in the testCompile configuration.

When I run gradle dependencies , I see all the expected libraries in the right configuration classpaths, but gradle compileJava fails because of the missing dependencies (in the original project, not the empty directory). I can see the pom files for the missing libraries, but NOT the jar files, in ~/.gradle. I have tried blowing away ~/.gradle and ~/.m2, to no effect.

Am I using the Java plugin incorrectly? Any help would be appreciated.

I am using Gradle 2.4 with Java 7 on OSX Yosemite.

the http components client and httpcomponents core libraries are marked as packaging pom in the according pom file. That’s why gradle doesn’t resolve any artifacts for those libraries.

double check:


Thank you, that explains the contents of ~/.gradle.

But it doesn’t solve my main problem, which is that the libraries are not present in the Java plugin dependency configurations. I’m not even able to compile.

If you follow the guidance from @Rene and check those POM files, you’ll see a list of modules. Those submodules contain the artifacts that you might need to compile.

You’re likely looking for


instead of


You might also need an additional dependency if you are using something besides what is contained the main httpclient and httpcore JAR files.

1 Like

Ahhh. Thank you so much @Rene and @jjustinic.