Sample project for gradle/gradle#18276
git clone https://github.com/sify21/gradletest
mkdir /tmp/repo
, then edit~/.m2/settings.xml
, uncommentlocalRepository
and set it to/tmp/repo
cd gradletest && mvn clean package
-> maven build succeeds../gradlew clean build
-> gradle build fails with this error:
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find com.google.inject:guice:4.0.
Searched in the following locations:
- file:/tmp/repo/com/google/inject/guice/4.0/guice-4.0.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project : > org.apache.maven:maven-core:3.5.0
- simply create a fake jar file without classifier to fix:
touch /tmp/repo/com/google/inject/guice/4.0/guice-4.0.jar
, then run./gradlew clean build
-> gradle build succeeds