Why isn't Gradle searching all repositories?

hello all,

i have these repos defined in my gradle build:

    mavenLocal()
    mavenCentral()

    maven
    {
        url = project.uri('https://repository.cloudera.com/artifactory/libs-release-local')
        url = project.uri('https://repo.maven.apache.org/maven2')
        url = project.uri('https://oss.sonatype.org/content/repositories/snapshots/')
        url = project.uri('https://repo1.maven.org/maven2/')
    }

and in the debug output from gradle, I can see that it has chosen not to search the cloudera repository:

2020-08-13T15:53:02.337-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver] Attempting to resolve component for org.apache.hadoop:hadoop-common:2.6.0-cdh5.6.0 using repositories [MavenLocal, MavenRepo, maven, maven2]

but that is where the artifact is (org.apache.hadoop:hadoop-common:2.6.0-cdh5.6.0)

how can i figure out what’s going wrong? thanks!

jon

This block calls setUrl(...) four times, the fourth one wins.

maven
    {
        url = project.uri('https://repository.cloudera.com/artifactory/libs-release-local')
        url = project.uri('https://repo.maven.apache.org/maven2')
        url = project.uri('https://oss.sonatype.org/content/repositories/snapshots/')
        url = project.uri('https://repo1.maven.org/maven2/')
    }

You should change to

maven { url = 'https://repository.cloudera.com/artifactory/libs-release-local' } 
maven { url = 'https://repo.maven.apache.org/maven2' } 
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots/'} 
maven { url = 'https://repo1.maven.org/maven2/' }

Thanks Lance!! I guess I looked at the wrong sample code.