Can someone explain why the ordering of mavenLocal() and mavenCentral() in repositories is significant?

I was running into this:

Artifact ‘commons-codec:commons-codec:1.4@jar’ not found.

Swapping:

repositories{

mavenLocal()

mavenCentral()

maven { url “http://repo.springsource.org/snapshot” }

maven { url “http://repo.springsource.org/milestone” } }

to

repositories{

mavenCentral()

mavenLocal()

maven { url “http://repo.springsource.org/snapshot” }

maven { url “http://repo.springsource.org/milestone” } }

resolved the issue.

WAT?

Hello Matt, I remember that there is an open gradle issue, that an artifact can not be resolved if its metadata is found in one repository, but the artifact itself cannot be found in the same repository. So my guess is, that in your mavenLocal repo there is a pom for commons-codec:commons-codec:1.4 but the artifact itself is not there.

by changing the ordering to look into mavenCentral first, the pom AND the jar itself can be resolved from the same repository (maven central)

cheers, René

The underlying mavenLocal bug has been fixed in Gradle 1.9 (http://issues.gradle.org/browse/GRADLE-2034).