From b74ba4686fe0cb2eafa6b7358bd2f072a927d3fe Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Wed, 10 Nov 2021 12:40:04 -0800 Subject: [PATCH] Upgrade spotless gradle plugin to 6.0.0 (#80560) (#80631) # Conflicts: # build-conventions/build.gradle --- build-conventions/build.gradle | 2 +- .../conventions/precommit/FormattingPrecommitPlugin.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build-conventions/build.gradle b/build-conventions/build.gradle index cce33d4699570..f540e7680fbfa 100644 --- a/build-conventions/build.gradle +++ b/build-conventions/build.gradle @@ -66,7 +66,7 @@ dependencies { api 'gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0' api 'org.apache.rat:apache-rat:0.11' compileOnly "com.puppycrawl.tools:checkstyle:8.42" - api('com.diffplug.spotless:spotless-plugin-gradle:5.16.0') { + api('com.diffplug.spotless:spotless-plugin-gradle:6.0.0') { exclude module: "groovy-xml" } } diff --git a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/FormattingPrecommitPlugin.java b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/FormattingPrecommitPlugin.java index 3bff5bcdf67e0..f106ad01b5212 100644 --- a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/FormattingPrecommitPlugin.java +++ b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/FormattingPrecommitPlugin.java @@ -50,6 +50,9 @@ public void apply(Project project) { project.getPlugins().apply(PrecommitTaskPlugin.class); project.getPlugins().apply(SpotlessPlugin.class); + // Spotless resolves required dependencies from project repositories, so we need maven central + project.getRepositories().mavenCentral(); + project.getExtensions().getByType(SpotlessExtension.class).java(java -> { String importOrderPath = "build-conventions/elastic.importorder"; String formatterConfigPath = "build-conventions/formatterConfig.xml";