Skip to content

Commit

Permalink
Fix Gradle 4.3.1 compatibility for logging (#27382)
Browse files Browse the repository at this point in the history
The build currently does not work with Gradle 4.3.1 as the Gradle team stopped publishing the gradle-logging dependency to jcenter, starting with 4.3.1 (not sure why). There are two options:

- Add the repository managed by Gradle team (https://repo.gradle.org/gradle/libs-releases-local) to our build
- Use an older version (4.3) of the dependency when running with Gradle 4.3.1.

Not to depend on another external repo, I've chosen solution 2. Note that this solution could break on future versions, but as this is a compileOnly dependency, and the interface we use has been super stable since forever, I don't envision this to be an issue (and easily detected by a breaking build).
  • Loading branch information
ywelsch committed Nov 15, 2017
1 parent f45c5b8 commit 8becc60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion buildSrc/build.gradle
Expand Up @@ -19,6 +19,8 @@

import java.nio.file.Files

import org.gradle.util.GradleVersion

apply plugin: 'groovy'

group = 'org.elasticsearch.gradle'
Expand Down Expand Up @@ -99,9 +101,11 @@ dependencies {

// Gradle 2.14+ removed ProgressLogger(-Factory) classes from the public APIs
// Use logging dependency instead
// Gradle 4.3.1 stopped releasing the logging jars to jcenter, just use the last available one
GradleVersion logVersion = GradleVersion.current() > GradleVersion.version('4.3') ? GradleVersion.version('4.3') : GradleVersion.current()

dependencies {
compileOnly "org.gradle:gradle-logging:${GradleVersion.current().getVersion()}"
compileOnly "org.gradle:gradle-logging:${logVersion.getVersion()}"
compile 'ru.vyarus:gradle-animalsniffer-plugin:1.2.0' // Gradle 2.14 requires a version > 1.0.1
}

Expand Down

0 comments on commit 8becc60

Please sign in to comment.