From 0b03f694a3a3b1b40dc87971427ab030842c1955 Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Thu, 20 May 2021 08:46:20 +0200 Subject: [PATCH] Fix Spotless failing with InvocationTargetException on JDK 16 (#73246) --- build.gradle | 2 +- gradle.properties | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 00d6814b668d..00ad8868915e 100644 --- a/build.gradle +++ b/build.gradle @@ -42,7 +42,7 @@ plugins { id 'elasticsearch.fips' id 'elasticsearch.internal-testclusters' id 'elasticsearch.run' - id "com.diffplug.spotless" version "5.12.0" apply false + id "com.diffplug.spotless" version "5.12.5" apply false } diff --git a/gradle.properties b/gradle.properties index 4f90b4405d33..2e458305180c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,7 @@ org.gradle.warning.mode=none org.gradle.parallel=true -org.gradle.jvmargs=-XX:+HeapDumpOnOutOfMemoryError -Xss2m +# We need to declare --add-exports to make spotless working seamlessly with jdk16 +org.gradle.jvmargs=-XX:+HeapDumpOnOutOfMemoryError -Xss2m --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED # Disable duplicate project id detection # See https://docs.gradle.org/current/userguide/upgrading_version_6.html#duplicate_project_names_may_cause_publication_to_fail