Some of the libraries require com.google.guava:guava:21.0
as the dependency, however gradle fails to fetch it from the maven repository . it’s a legacy project, so versions are not the latest.
Error log:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find guava-21.0-cdi1.0.jar (com.google.guava:guava:21.0).
Searched in the following locations:
https://repo.maven.apache.org/maven2/com/google/guava/guava/21.0/guava-21.0-cdi1.0.jar
guava-21.0.jar
(without -cdi1.0
suffix) exists on that path. Why does gradle ads the -cdi1.0
suffix to the filename and is it possible to disable this feature? or i simply misunderstanding something and there is something else in play?
i tried to specify guava
dep separately compile(group: 'com.google.guava', name: 'guava', version: '21.0')
, however it doesn’t affect anything.
build.gradle: (generated by gradle init
from maven pom.xml)
plugins {
id 'java'
id 'maven-publish'
}
repositories {
mavenCentral()
maven {
url = 'http://repo.maven.apache.org/maven2'
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web:1.4.1.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-jdbc:1.4.1.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-actuator:1.4.1.RELEASE'
... etc other deps
}
group = 'com.springapp'
version = '1.0-SNAPSHOT'
description = 'someproj'
java.sourceCompatibility = JavaVersion.VERSION_1_8
publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}