Skip to content

Commit 2cb375d

Browse files
committed
Add support for Java 25
Closes gh-1912
1 parent dc20c9b commit 2cb375d

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

start-site/src/main/java/io/spring/start/site/project/JavaVersionProjectDescriptionCustomizer.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@
3737
*/
3838
public class JavaVersionProjectDescriptionCustomizer implements ProjectDescriptionCustomizer {
3939

40-
private static final VersionRange SPRING_BOOT_3_4_OR_LATER = VersionParser.DEFAULT.parseRange("3.4.0");
40+
private static final VersionRange SPRING_BOOT_3_5_OR_LATER = VersionParser.DEFAULT.parseRange("3.5.0");
4141

4242
private static final List<String> UNSUPPORTED_VERSIONS = Arrays.asList("1.6", "1.7", "1.8");
4343

44+
private static final int MAX_JAVA_VERSION = 25;
45+
4446
@Override
4547
public void customize(MutableProjectDescription description) {
4648
String javaVersion = description.getLanguage().jvmVersion();
@@ -61,11 +63,11 @@ public void customize(MutableProjectDescription description) {
6163
updateTo(description, "21");
6264
}
6365
}
64-
if (javaGeneration >= 24) {
65-
// Spring Boot < 3.4.x supports Java 23 at most
66+
if (javaGeneration >= 25) {
67+
// Spring Boot < 3.5.x supports Java 24 at most
6668
Version platformVersion = description.getPlatformVersion();
67-
if (!SPRING_BOOT_3_4_OR_LATER.match(platformVersion)) {
68-
updateTo(description, "23");
69+
if (!SPRING_BOOT_3_5_OR_LATER.match(platformVersion)) {
70+
updateTo(description, "24");
6971
}
7072
}
7173
}
@@ -82,7 +84,7 @@ private void updateTo(MutableProjectDescription description, String jvmVersion)
8284
private Integer determineJavaGeneration(String javaVersion) {
8385
try {
8486
int generation = Integer.parseInt(javaVersion);
85-
return (generation > 9 && generation <= 24) ? generation : null;
87+
return (generation >= 9 && generation <= MAX_JAVA_VERSION) ? generation : null;
8688
}
8789
catch (NumberFormatException ex) {
8890
return null;

start-site/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@ initializr:
20392039
id: war
20402040
default: false
20412041
javaVersions:
2042-
- id: 24
2042+
- id: 25
20432043
default: false
20442044
- id: 21
20452045
default: false

start-site/src/test/java/io/spring/start/site/project/JavaVersionProjectDescriptionCustomizerTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ void java23IsNotSupportedWithKotlin() {
7676
}
7777

7878
@Test
79-
void java24IsNotSupportedWithKotlin() {
80-
assertThat(mavenPom(kotlinProject("24", SupportedBootVersion.latest().getVersion())))
79+
void java25IsNotSupportedWithKotlin() {
80+
assertThat(mavenPom(kotlinProject("25", SupportedBootVersion.latest().getVersion())))
8181
.hasProperty("java.version", "21");
8282
}
8383

@@ -93,7 +93,7 @@ static Stream<Arguments> supportedGradleGroovyParameters() {
9393
private static Stream<Arguments> supportedJavaParameters() {
9494
return Stream.of(java("17", SupportedBootVersion.latest().getVersion()),
9595
java("21", SupportedBootVersion.latest().getVersion()),
96-
java("24", SupportedBootVersion.latest().getVersion()));
96+
java("25", SupportedBootVersion.latest().getVersion()));
9797
}
9898

9999
private static Stream<Arguments> supportedKotlinParameters() {
@@ -102,7 +102,7 @@ private static Stream<Arguments> supportedKotlinParameters() {
102102

103103
private static Stream<Arguments> supportedGroovyParameters() {
104104
return Stream.of(groovy("21", SupportedBootVersion.latest().getVersion()),
105-
groovy("24", SupportedBootVersion.latest().getVersion()));
105+
groovy("25", SupportedBootVersion.latest().getVersion()));
106106
}
107107

108108
private static Arguments java(String javaVersion, String springBootVersion) {

0 commit comments

Comments
 (0)