GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bump the min Gradle and Java requirements to 7.3 and 17 by Goooler · Pull Request #2540 · diffplug/spotless

Bump the min Gradle and Java requirements to 7.3 and 17 #2540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
nedtwigg merged 4 commits into main from g/20250702/gradle-9
Jul 20, 2025

Uh oh!

There was an error while loading. Please reload this page.

Merged

Bump the min Gradle and Java requirements to 7.3 and 17 #2540

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
4 commits
Select commit Hold shift + click to select a range
8ae59f2
Bump the min Gradle requirement to 7.1 and test on 9.0.0-rc-1
Goooler Jul 2, 2025
4c80f8e
Bump the min Gradle and Java requirements to 7.3 and 17
Goooler Jul 8, 2025
da0ff27
Merge branch 'main' into g/20250702/gradle-9
Jul 20, 2025
5949783
Register the bump from 11 to 17 as **BREAKING** in the changelogs.
Jul 20, 2025
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

5 changes: 2 additions & 3 deletions 5 .github/workflows/changelog-print.yml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ jobs:
name: changelogPrint
steps:
- uses: actions/checkout@v4
- name: jdk 11
uses: actions/setup-java@v4
- uses: actions/setup-java@v4
with:
java-version: 11
java-version: 21
distribution: 'temurin'
- name: gradle caching
uses: gradle/actions/setup-gradle@v4
Expand Down
25 changes: 8 additions & 17 deletions 25 .github/workflows/ci.yml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install JDK 11
uses: actions/setup-java@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 11
java-version: 21
- name: gradle caching
uses: gradle/actions/setup-gradle@v4
- name: spotlessCheck
Expand All @@ -41,33 +40,25 @@ jobs:
matrix:
kind: [maven, gradle]
# Test on the latest Java version once Gradle & Maven support it.
jre: [11, 17, 21, 24]
os: [ubuntu-latest]
jre: [17, 21, 24]
os: [ubuntu-latest, windows-latest]
include:
# test windows at the diagonals of the above matrix
- kind: maven
jre: 11
os: windows-latest
- kind: gradle
jre: 17
os: windows-latest
# npm on linux only (crazy slow on windows)
- kind: npm
jre: 11
jre: 17
os: ubuntu-latest
- kind: shfmt
jre: 11
jre: 17
os: ubuntu-latest
shfmt-version: v3.8.0
- kind: idea
jre: 11
jre: 17
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }}
uses: actions/setup-java@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ matrix.jre }}
Expand Down
5 changes: 2 additions & 3 deletions 5 .github/workflows/deploy.yml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ jobs:
ORG_GRADLE_PROJECT_gpg_key64: ${{ secrets.GPG_KEY64 }}
steps:
- uses: actions/checkout@v4
- name: jdk 11
uses: actions/setup-java@v4
- uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'temurin'
- name: gradle caching
uses: gradle/actions/setup-gradle@v4
Expand Down
2 changes: 2 additions & 0 deletions 2 CHANGES.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This document is intended for Spotless developers.
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).

## [Unreleased]
### Changes
* **BREAKING** Bump the required Java to `17`. ([#2375](https://github.com/diffplug/spotless/issues/2375), [#2540](https://github.com/diffplug/spotless/pull/2540))

## [3.3.0] - 2025-07-20
### Added
Expand Down
3 changes: 2 additions & 1 deletion 3 gradle.properties
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1024m -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache.parallel=true

name=spotless
description=Spotless - keep your code spotless with Gradle
Expand Down Expand Up @@ -32,4 +33,4 @@ VER_JGIT=6.10.1.202505221210-r
VER_JUNIT=5.13.3
VER_ASSERTJ=3.27.3
VER_MOCKITO=5.18.0
VER_SELFIE=2.5.3
VER_SELFIE=2.5.3
Binary file modified BIN +1.65 KB (100%) gradle/wrapper/gradle-wrapper.jar
Show comments
View file
Open in desktop
Binary file not shown.
2 changes: 1 addition & 1 deletion 2 gradle/wrapper/gradle-wrapper.properties
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-rc-1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion 2 gradlew
Show comments
View file
Open in desktop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

4 changes: 0 additions & 4 deletions 4 lib-extra/src/test/java/com/diffplug/spotless/extra/cpp/EclipseCdtFormatterStepTest.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
*/
package com.diffplug.spotless.extra.cpp;

import static org.junit.jupiter.api.condition.JRE.JAVA_17;

import java.util.stream.Stream;

import org.junit.jupiter.api.condition.EnabledForJreRange;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

Expand All @@ -33,7 +30,6 @@ public EclipseCdtFormatterStepTest() {

@ParameterizedTest
@MethodSource
@EnabledForJreRange(min = JAVA_17)
void formatWithVersion(String version) throws Exception {
harnessFor(version).test("main.c",
"#include <a.h>;\nint main(int argc, \nchar *argv[]) {}",
Expand Down
7 changes: 7 additions & 0 deletions 7 lib/build.gradle
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.gradle.util.GradleVersion

plugins {
id 'java-library'
id 'io.github.davidburstrom.version-compatibility'
Expand Down Expand Up @@ -148,6 +150,11 @@ tasks.withType(Test).configureEach {
// https://docs.gradle.org/7.5/userguide/upgrading_version_7.html#removes_implicit_add_opens_for_test_workers
jvmArgs "--add-opens=java.base/java.lang=ALL-UNNAMED"
}

if (GradleVersion.current() >= GradleVersion.version('9.0')) {
// https://github.com/gradle/gradle/issues/33619
failOnNoDiscoveredTests = false
}
}

jar {
Expand Down
2 changes: 2 additions & 0 deletions 2 plugin-gradle/CHANGES.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`).

## [Unreleased]
### Changed
* **BREAKING** Bump the required Gradle to `7.3` and required Java to `17`. ([#2375](https://github.com/diffplug/spotless/issues/2375), [#2540](https://github.com/diffplug/spotless/pull/2540))

## [7.2.0] - 2025-07-20
### Added
Expand Down
12 changes: 2 additions & 10 deletions 12 plugin-gradle/src/main/java/com/diffplug/gradle/spotless/GroovyExtension.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2023 DiffPlug
* Copyright 2016-2025 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,11 +18,8 @@
import javax.inject.Inject;

import org.gradle.api.GradleException;
import org.gradle.api.internal.plugins.DslObject;
import org.gradle.api.plugins.GroovyBasePlugin;
import org.gradle.api.tasks.GroovySourceDirectorySet;
import org.gradle.api.tasks.GroovySourceSet;
import org.gradle.util.GradleVersion;

import com.diffplug.spotless.generic.LicenseHeaderStep;

Expand Down Expand Up @@ -66,12 +63,7 @@ protected void setupTask(SpotlessTask task) {
target = getSources(getProject(),
message,
sourceSet -> {
if (GradleVersion.current().compareTo(GradleVersion.version(SpotlessPlugin.VER_GRADLE_javaPluginExtension)) >= 0) {
return sourceSet.getExtensions().getByType(GroovySourceDirectorySet.class);
} else {
final GroovySourceSet groovySourceSet = new DslObject(sourceSet).getConvention().getPlugin(GroovySourceSet.class);
return groovySourceSet.getGroovy();
}
return sourceSet.getExtensions().getByType(GroovySourceDirectorySet.class);
},
file -> {
final String name = file.getName();
Expand Down
21 changes: 5 additions & 16 deletions 21 plugin-gradle/src/main/java/com/diffplug/gradle/spotless/JvmLang.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 DiffPlug
* Copyright 2023-2025 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,31 +22,20 @@
import org.gradle.api.Project;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.SourceDirectorySet;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.specs.Spec;
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.SourceSetContainer;
import org.gradle.util.GradleVersion;

interface JvmLang {

default FileCollection getSources(Project project, String message, Function<SourceSet, SourceDirectorySet> sourceSetSourceDirectory, Spec<? super File> filterSpec) {
final SourceSetContainer sourceSets;
FileCollection union = project.files();
if (GradleVersion.current().compareTo(GradleVersion.version(SpotlessPlugin.VER_GRADLE_javaPluginExtension)) >= 0) {
final JavaPluginExtension javaPluginExtension = project.getExtensions().findByType(JavaPluginExtension.class);
if (javaPluginExtension == null) {
throw new GradleException(message);
}
sourceSets = javaPluginExtension.getSourceSets();
} else {
final JavaPluginConvention javaPluginConvention = project.getConvention().findPlugin(JavaPluginConvention.class);
if (javaPluginConvention == null) {
throw new GradleException(message);
}
sourceSets = javaPluginConvention.getSourceSets();
final JavaPluginExtension javaPluginExtension = project.getExtensions().findByType(JavaPluginExtension.class);
if (javaPluginExtension == null) {
throw new GradleException(message);
}
final SourceSetContainer sourceSets = javaPluginExtension.getSourceSets();
for (SourceSet sourceSet : sourceSets) {
union = union.plus(sourceSetSourceDirectory.apply(sourceSet).filter(filterSpec));
}
Expand Down
5 changes: 2 additions & 3 deletions 5 plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessPlugin.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@

public class SpotlessPlugin implements Plugin<Project> {
static final String SPOTLESS_MODERN = "spotlessModern";
static final String VER_GRADLE_min = "6.1.1";
static final String VER_GRADLE_javaPluginExtension = "7.1";
static final String VER_GRADLE_min = "7.3";
static final String VER_GRADLE_minVersionForCustom = "8.4";
private static final int MINIMUM_JRE = 11;
private static final int MINIMUM_JRE = 17;

@Override
public void apply(Project project) {
Expand Down
23 changes: 7 additions & 16 deletions 23 plugin-gradle/src/test/java/com/diffplug/gradle/spotless/GradleIntegrationHarness.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@

public class GradleIntegrationHarness extends ResourceHarness {
public enum GradleVersionSupport {
JRE_11("5.0"), MINIMUM(SpotlessPlugin.VER_GRADLE_min), CUSTOM_STEPS(SpotlessPlugin.VER_GRADLE_minVersionForCustom),
// technically, this API exists in 6.5, but the flags for it change in 6.6, so we build to that
CONFIGURATION_CACHE("6.6"),
MINIMUM(SpotlessPlugin.VER_GRADLE_min),

// https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:stable
STABLE_CONFIGURATION_CACHE("7.5");
STABLE_CONFIGURATION_CACHE("7.5"),

CUSTOM_STEPS(SpotlessPlugin.VER_GRADLE_minVersionForCustom),

;

final String version;

Expand Down Expand Up @@ -77,18 +80,6 @@ public enum GradleVersionSupport {
case 18:
minVersionForRunningJRE = "7.5";
break;
case 17:
minVersionForRunningJRE = "7.3";
break;
case 16:
minVersionForRunningJRE = "7.0";
break;
case 15:
minVersionForRunningJRE = "6.7";
break;
case 14:
minVersionForRunningJRE = "6.3";
break;
default:
minVersionForRunningJRE = null;
break;
Expand Down
2 changes: 1 addition & 1 deletion 2 plugin-gradle/src/test/java/com/diffplug/gradle/spotless/NativeCmdIntegrationTest.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class NativeCmdWithConfigCacheTest extends GradleIntegrationHarness implements N
public GradleRunner gradleRunner() throws IOException {
setFile("gradle.properties").toLines("org.gradle.unsafe.configuration-cache=true",
"org.gradle.configuration-cache=true");
return super.gradleRunner().withGradleVersion(GradleVersionSupport.CONFIGURATION_CACHE.version);
return super.gradleRunner();
}
}
}
36 changes: 1 addition & 35 deletions 36 plugin-gradle/src/test/java/com/diffplug/gradle/spotless/SpotlessPluginRedirectTest.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2023 DiffPlug
* Copyright 2020-2025 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,13 +15,10 @@
*/
package com.diffplug.gradle.spotless;

import static org.junit.jupiter.api.condition.JRE.JAVA_11;

import java.io.IOException;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledForJreRange;

import com.diffplug.common.base.StringPrinter;

Expand All @@ -39,35 +36,4 @@ void redirectPluginModernGradle() throws IOException {
" To migrate:",
" - Test your build with: id 'com.diffplug.gradle.spotless' version '4.5.1'"));
}

@Test
@EnabledForJreRange(max = JAVA_11)
void redirectPluginOldGradle() throws IOException {
setFile("build.gradle").toLines(
"plugins {",
" id 'com.diffplug.gradle.spotless'",
"}");
Assertions.assertThat(gradleRunner().withGradleVersion(GradleVersionSupport.JRE_11.version)
.buildAndFail().getOutput().replace("\r", ""))
.contains(StringPrinter.buildStringFromLines(
"> Failed to apply plugin [id 'com.diffplug.gradle.spotless']",
" > We have moved from 'com.diffplug.gradle.spotless'",
" to 'com.diffplug.spotless'",
" To migrate:",
" - Upgrade Gradle to 6.1.1 or newer (you're on 5.0)",
" - Test your build with: id 'com.diffplug.gradle.spotless' version '4.5.1'"));
}

@Test
@EnabledForJreRange(max = JAVA_11)
void realPluginOldGradle() throws IOException {
setFile("build.gradle").toLines(
"plugins {",
" id 'com.diffplug.spotless'",
"}");
Assertions.assertThat(gradleRunner().withGradleVersion(GradleVersionSupport.JRE_11.version)
.buildAndFail().getOutput().replace("\r", ""))
.contains(StringPrinter.buildStringFromLines(
"Spotless requires Gradle 6.1.1 or newer, this was 5.0"));
}
}
2 changes: 2 additions & 0 deletions 2 plugin-maven/CHANGES.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).

## [Unreleased]
### Changes
* **BREAKING** Bump the required Java to `17`. ([#2375](https://github.com/diffplug/spotless/issues/2375), [#2540](https://github.com/diffplug/spotless/pull/2540))

## [2.46.0] - 2025-07-20
### Added
Expand Down
2 changes: 1 addition & 1 deletion 2 testlib/build.gradle
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apply from: rootProject.file('gradle/java-setup.gradle')

dependencies {
api projects.lib
api files(projects.lib.dependencyProject.sourceSets.sortPom.output.classesDirs)
api files(project(projects.lib.path).sourceSets.sortPom.output.classesDirs)
api "com.diffplug.durian:durian-core:${VER_DURIAN}"
api "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
api "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"
Expand Down
4 changes: 2 additions & 2 deletions 4 testlib/src/main/java/com/diffplug/spotless/TestProvisioner.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2024 DiffPlug
* Copyright 2016-2025 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -82,7 +82,7 @@ private static Provisioner createWithRepositories(Consumer<RepositoryHandler> re
return config.resolve();
} catch (ResolveException e) {
/* Provide Maven coordinates in exception message instead of static string 'detachedConfiguration' */
throw new ResolveException(config.getDescription(), e);
throw new RuntimeException("Error resolving configuration: " + config.getDescription(), e);
} finally {
// delete the temp dir
try {
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.