4

Go to fire up my clojure/lein app this morning and suddenly I am getting this error!

Retrieving lein-clojars/lein-clojars/0.9.1/lein-clojars-0.9.1.pom from clojars
Retrieving lein-clojars/lein-clojars/0.9.1/lein-clojars-0.9.1.jar from clojars
Could not find metadata org.codehaus.jackson:jackson-core-asl/maven-metadata.xml in local (/Users/JD/.m2/repository)
Could not transfer metadata org.codehaus.jackson:jackson-core-asl/maven-metadata.xml from/to central (http://repo1.maven.org/maven2/): Checksum validation failed, expected e3f022e29dff365daf755e2c89fe42867e7addac but is aed947332fa98b1f9cd176faa3d046faa1e48bc9
Failure to find org.codehaus.jackson:jackson-core-asl/maven-metadata.xml in https://clojars.org/repo/ was cached in the local repository, resolution will not be reattempted until the update interval of clojars has elapsed or updates are forced
This could be due to a typo in :dependencies or network issues.
Could not resolve dependencies

Checksum validation error? On jackson-core-asl? There are no typos or network issues (verified). What is going on here! Anyone have a clue?

Thanks!

skuro
  • 13,414
  • 1
  • 48
  • 67
prismofeverything
  • 8,799
  • 8
  • 38
  • 53

2 Answers2

3

The maven-metadata.xml for jackson-core-asl has indeed an MD5 file of aed947332fa98b1f9cd176faa3d046faa1e48bc9, while the one leiningen calculated over the downloaded file is e3f022e29dff365daf755e2c89fe42867e7addac. This can occur when e.g. there's some network issue while downloading an artifact from the remote repository: it can happen that in such cases a failure HTTP code such as 404 is disregarded, and the hash is calculated over the HTML page describing the error.

Make sure you can reach the artifact at least manually (i.e. no 404 or such), issue a

rm -R ~/.m2/repository/org/codehaus/jackson

and retry.

skuro
  • 13,414
  • 1
  • 48
  • 67
  • I removed it and retried but I get the same error. The checksum is still bad! – prismofeverything Jan 30 '13 at 18:49
  • and if you type http://search.maven.org/remotecontent?filepath=org/codehaus/jackson/jackson-core-asl/maven-metadata.xml on your browser can you actually download the file? – skuro Jan 31 '13 at 09:10
  • 1
    I just ran into this, and deleting the relevant directory from the local Maven repo didn't work. However, I found a way around it via https://groups.google.com/forum/?fromgroups=#!topic/leiningen/Tz7Q6XgYcnA and http://stackoverflow.com/questions/10504076/how-to-force-lein-deps-to-re-fetch-local-jars-libs. If you are willing to overlook the checksum error, just use Maven to resolve the dependencies and re-run lein deps: mvn -U dependency:resolve; lein deps – Robin Kraft Apr 02 '13 at 19:09
3

Apart from the answer given by @skuro, other common reason I've experience with this problem is when you're behind a company's internal repository (eg: nexus) which proxies central. You should check your ~/.m2/settings.xml mirror setting, and if you have such internal repo, check it's consistency against http://search.maven.org. Often the jars on your company repo is corrupted and you need to delete it so it re-download from central

gerrytan
  • 40,313
  • 9
  • 84
  • 99