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.
Gradle should use libraries from the project-locale Maven repository.
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
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()
}
}
}
Most helpful comment
If your repo does not contain
pom
metadata, you now have to addartifact()
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