Gradle 1.4-rc1 - cannot find dom4j

I have a dependency list like this:

dependencies {
    compile group: "annogen", name: "annogen", version: "0.1.0"
    compile group: "backport-util-concurrent", name: "backport-util-concurrent", version: "2.2"
    compile group: "org.bouncycastle", name: "bcpg-jdk15on", version: "1.47"
    compile group: "org.apache.commons", name: "commons-compress", version: "1.4.1"
    compile group: "commons-digester", name: "commons-digester", version: "2.1"
    compile group: "commons-fileupload", name: "commons-fileupload", version: "1.2.2"
    compile group: "commons-httpclient", name: "commons-httpclient", version: "3.1"
    compile group: "commons-io", name: "commons-io", version: "1.4"
    compile group: "commons-lang", name: "commons-lang", version: "2.4"
    compile group: "servlets.com", name: "cos", version: "05Nov2002"
    compile group: "org.apache.cxf", name: "cxf-bundle", version: "2.6.1"
    compile group: "com.enterprisedt", name: "edtFTPj", version: "1.5.3"
    compile group: "ehcache", name: "ehcache", version: "1.2.3"
    compile group: "org.hibernate", name: "hibernate-core", version: "3.6.10.Final"
    compile group: "org.jasypt", name: "jasypt", version: "1.9.0"
    compile group: "javax.xml", name: "jaxrpc", version: "1.1"
    compile group: "org.jdom", name: "jdom", version: "1.1.3"
    compile group: "org.json", name: "json", version: "20090211"
    compile group: "javax.jms", name: "jms-api", version: "1.1-rev-1"
    compile group: "javax.transaction", name: "jta", version: "1.1"
    compile group: "com.googlecode.juniversalchardet", name: "juniversalchardet", version: "1.0.3"
    compile group: "javax.mail", name: "mail", version: "1.4.5"
    compile group: "org.mozilla", name: "rhino", version: "1.7R4"
    compile group: "oro", name: "oro", version: "2.0.8"
    compile group: "pdfbox", name: "pdfbox", version: "0.7.3"
    compile group: "org.springframework", name: "spring-webmvc", version: "3.1.2.RELEASE"
    compile group: "org.springframework.security", name: "spring-security-web", version: "3.1.2.RELEASE"
    compile group: "xerces", name: "xercesImpl", version: "2.10.0"
    compile group: "xmlrpc", name: "xmlrpc", version: "2.0.1"

dom4j seems to be a transitive dependency of at least one of these.

However, I get this error: https://gist.github.com/4565671

I checked that dom4j 1.6.1 is in Maven central.

Are you saying that you are hitting this problem with 1.4-rc-1, but not with earlier versions? Make sure to try with ‘clean’ and ‘–refresh-dependencies’. Also, can you show the ‘repositories’ section?

Actually, I did have the problem with 1.3 as well. Although I did run with --refresh-dependencies I have no yet tried clean.

This is my repositories section, which also uses a local Artifactory instance (that is currently disabled):

String artifactRepoUser = "admin"
String artifactRepoPass = "password"
String artifactRepoBase = "http://localhost:8080/artifactory"
  Closure standardCredentials = {
    username artifactRepoUser
    password artifactRepoPass
}
  repositories {
    mavenLocal()
    maven {
        url "${artifactRepoBase}/remote-repos"
        credentials(standardCredentials)
    }
    maven {
        url "${artifactRepoBase}/libs-release"
        credentials(standardCredentials)
    }
    maven {
        url "${artifactRepoBase}/libs-snapshot"
        credentials(standardCredentials)
    }
    mavenCentral()
}

One thing that may not have helped is that the project was once built while pulling from the local Artifactory instance only, and then I enabled Maven Central later while shutting down the Artifactory instance.

Resolves fine for me. Try with ‘–refresh-dependencies’ and without ‘mavenLocal()’. If that doesn’t help, try deleting (or renaming) ‘~/.gradle’.

The combination of deleting the gradle cache and using --refresh-dependencies seems to have worked. Thanks!