Gradle: Gradle 6.0 seems to ignore project-local Maven repository

Created on 12 Nov 2019  路  1Comment  路  Source: gradle/gradle

After an upgrade to Gradle 6.0 builds with project-local Maven repositories specified with

repositories {
    //...
    maven { url uri('lib') }
}

do not work anymore. The last know-good version of Gradle is 5.6.2.

The lib directory resides in the project and contains a Maven file system structure. That contains the required dependencies.

Expected Behavior

Gradle should use libraries from the project-locale Maven repository.

Current Behavior

The build fails.

Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find com.acme:seclib:1.0.0.
     Searched in the following locations:
       - https://jcenter.bintray.com/com/acme/seclib/1.0.0/maven-metadata.xml
       - https://jcenter.bintray.com/com/acme/seclib/1.0.0/seclib-1.0.0.pom
       - file:/gateway/lib/com/acme/seclib/1.0.0/maven-metadata.xml
       - file:/gateway/lib/com/acme/seclib/1.0.0/seclib-1.0.0.pom
     Required by:
         project :

This bug may be related to https://github.com/gradle/gradle/issues/11321

contributor dependency-management

Most helpful comment

If your repo does not contain pom metadata, you now have to add artifact() metadata source to your repository. See migration guide section: https://docs.gradle.org/current/userguide/upgrading_version_5.html#maven_or_ivy_repositories_are_no_longer_queried_for_artifacts_without_metadata_by_default

repositories {
    maven {
        url uri('lib') 
        metadataSources {
            artifact()
        }
    }
}

>All comments

If your repo does not contain pom metadata, you now have to add artifact() metadata source to your repository. See migration guide section: https://docs.gradle.org/current/userguide/upgrading_version_5.html#maven_or_ivy_repositories_are_no_longer_queried_for_artifacts_without_metadata_by_default

repositories {
    maven {
        url uri('lib') 
        metadataSources {
            artifact()
        }
    }
}
Was this page helpful?
0 / 5 - 0 ratings