diff --git a/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/ConfigurationCacheTest.java b/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/ConfigurationCacheTest.java index 396a884cc5..70be5adb82 100644 --- a/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/ConfigurationCacheTest.java +++ b/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/ConfigurationCacheTest.java @@ -20,6 +20,8 @@ import org.gradle.testkit.runner.BuildResult; import org.gradle.testkit.runner.GradleRunner; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledForJreRange; +import org.junit.jupiter.api.condition.JRE; public class ConfigurationCacheTest extends GradleIntegrationHarness { @Override @@ -63,6 +65,7 @@ public void helpConfiguresIfTasksAreCreated() throws IOException { } @Test + @EnabledForJreRange(max = JRE.JAVA_20) public void jvmLocalCache() throws IOException { setFile("build.gradle").toLines( "plugins {", @@ -91,6 +94,10 @@ public void jvmLocalCache() throws IOException { gradleRunner().withArguments("spotlessApply").build(); assertFile("test.java").sameAsResource("java/googlejavaformat/JavaCodeFormatted.test"); + // the withDebug forces it to start a new deamon, but only in Gradle 8.3 and older + // starting with Gradle 8.5 this doesn't work anymore + // and we need Gradle 8.5 for Java 21 + // so we can't test this on Java 21 for now BuildResult failure = gradleRunner().withDebug(true).withArguments("spotlessApply", "--stacktrace").buildAndFail(); failure.getOutput().contains("Spotless daemon-local cache is stale. Regenerate the cache with\n" + " rm -rf .gradle/configuration-cache\n" +