Resolve Gradle Transitive Dependency Conflict with file system libs (ie. not maven, ivy)

We have a java project with dependencies that looks something like this.

A -} B -} httpcore-4.0.1

\

C -} httpcore-4.1.3

So there is transitive dependency conflict in A. The gradle docs say that the resolution policy is to select the newest (http://gradle.org/docs/current/userguide/dependency_management.html). However, we get compile errors due to function signature differences so the latest doesn’t seem to be selected. I’ve seen various exclude methods but not sure how they apply when we are using a file system based dependency lib (not maven or ivy). Eclipse seems to resolve the problem okay and compile but gradle barfs. I’ve tried various forms of:

configurations {

all*.exclude group:‘org.apache’, name: ‘httpcore’, version:‘4.0.1’

all*.exclude group:‘org.apache.httpcomponents’, name: ‘httpcore’, version:‘4.0.1’

}

What am I missing here?

I’m using Gradle 1.0-milestone-8a

Conflict resolution only works when you are using dependency repositories (local or remote), because the metadata is necessary.

If you’re just pulling jar files from a directory, then no conflict resolution happens.

Roger that. Thanks for the reply Luke.