Skip to content

Commit 37d5315

Browse files
patbaumgartnerdsyer
authored andcommitted
Upgrade to Spring Boot 4.0.0
Signed-off-by: Patrick Baumgartner <contact@patbaumgartner.com>
1 parent b5a630b commit 37d5315

12 files changed

Lines changed: 24 additions & 27 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ A similar setup is provided for MySQL and PostgreSQL if a persistent database co
6060
You can start MySQL or PostgreSQL locally with whatever installer works for your OS or use docker:
6161

6262
```bash
63-
docker run -e MYSQL_USER=petclinic -e MYSQL_PASSWORD=petclinic -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:9.2
63+
docker run -e MYSQL_USER=petclinic -e MYSQL_PASSWORD=petclinic -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:9.5
6464
```
6565

6666
or
6767

6868
```bash
69-
docker run -e POSTGRES_USER=petclinic -e POSTGRES_PASSWORD=petclinic -e POSTGRES_DB=petclinic -p 5432:5432 postgres:18.0
69+
docker run -e POSTGRES_USER=petclinic -e POSTGRES_PASSWORD=petclinic -e POSTGRES_DB=petclinic -p 5432:5432 postgres:18.1
7070
```
7171

7272
Further documentation is provided for [MySQL](https://github.com/spring-projects/spring-petclinic/blob/main/src/main/resources/db/mysql/petclinic_db_setup_mysql.txt)

build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
plugins {
22
id 'java'
33
id 'checkstyle'
4-
id 'org.springframework.boot' version '4.0.0-RC2'
4+
id 'org.springframework.boot' version '4.0.0'
55
id 'io.spring.dependency-management' version '1.1.7'
66
id 'org.graalvm.buildtools.native' version '0.11.1'
7-
id 'org.cyclonedx.bom' version '3.0.0'
7+
id 'org.cyclonedx.bom' version '3.0.2'
88
id 'io.spring.javaformat' version '0.0.47'
99
id "io.spring.nohttp" version "0.0.11"
1010
id 'net.ltgt.errorprone' version '4.3.0'
@@ -25,9 +25,9 @@ repositories {
2525
mavenCentral()
2626
}
2727

28-
ext.checkstyleVersion = "11.1.0"
28+
ext.checkstyleVersion = "12.1.2"
2929
ext.springJavaformatCheckstyleVersion = "0.0.47"
30-
ext.webjarsLocatorLiteVersion = "1.1.1"
30+
ext.webjarsLocatorLiteVersion = "1.1.2"
3131
ext.webjarsFontawesomeVersion = "4.7.0"
3232
ext.webjarsBootstrapVersion = "5.3.8"
3333
ext.errorProneVersion = "2.42.0"
@@ -78,7 +78,6 @@ checkstyleNohttp {
7878
}
7979

8080
tasks.withType(JavaCompile).configureEach {
81-
options.release = 17
8281
options.errorprone {
8382
disableAllChecks = true
8483
}

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
mysql:
3-
image: mysql:9.2
3+
image: mysql:9.5
44
ports:
55
- "3306:3306"
66
environment:
@@ -12,7 +12,7 @@ services:
1212
volumes:
1313
- "./conf.d:/etc/mysql/conf.d:ro"
1414
postgres:
15-
image: postgres:18.0
15+
image: postgres:18.1
1616
ports:
1717
- "5432:5432"
1818
environment:

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

k8s/db.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
app: demo-db
4242
spec:
4343
containers:
44-
- image: postgres:18.0
44+
- image: postgres:18.1
4545
name: postgresql
4646
env:
4747
- name: POSTGRES_USER

mvnw

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>4.0.0-RC2</version>
8+
<version>4.0.0</version>
99
<relativePath></relativePath>
1010
</parent>
1111

@@ -19,20 +19,19 @@
1919

2020
<!-- Generic properties -->
2121
<java.version>25</java.version>
22-
<maven.compiler.release>17</maven.compiler.release>
2322
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2423
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2524
<!-- Important for reproducible builds. Update using e.g. ./mvnw versions:set -DnewVersion=... -->
26-
<project.build.outputTimestamp>2024-11-28T14:37:52Z</project.build.outputTimestamp>
25+
<project.build.outputTimestamp>2025-11-22T16:15:42Z</project.build.outputTimestamp>
2726

2827
<!-- Web dependencies -->
29-
<webjars-locator.version>1.1.1</webjars-locator.version>
28+
<webjars-locator.version>1.1.2</webjars-locator.version>
3029
<webjars-bootstrap.version>5.3.8</webjars-bootstrap.version>
3130
<webjars-font-awesome.version>4.7.0</webjars-font-awesome.version>
3231

33-
<checkstyle.version>11.1.0</checkstyle.version>
32+
<checkstyle.version>12.1.2</checkstyle.version>
3433
<error-prone.version>2.42.0</error-prone.version>
35-
<jacoco.version>0.8.13</jacoco.version>
34+
<jacoco.version>0.8.14</jacoco.version>
3635
<libsass.version>0.3.4</libsass.version>
3736
<lifecycle-mapping>1.0.0</lifecycle-mapping>
3837
<maven-checkstyle.version>3.6.0</maven-checkstyle.version>
@@ -290,10 +289,10 @@
290289
<executions>
291290
<execution>
292291
<id>default-compile</id>
293-
<phase>compile</phase>
294292
<goals>
295293
<goal>compile</goal>
296294
</goals>
295+
<phase>compile</phase>
297296
<configuration>
298297
<compilerArgs>
299298
<arg>-XDcompilePolicy=simple</arg>

src/main/java/org/springframework/samples/petclinic/owner/OwnerRepository.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import java.util.Optional;
1919

20-
import jakarta.annotation.Nonnull;
2120
import org.springframework.data.domain.Page;
2221
import org.springframework.data.domain.Pageable;
2322
import org.springframework.data.jpa.repository.JpaRepository;

src/test/java/org/springframework/samples/petclinic/MySqlIntegrationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
import org.springframework.test.context.ActiveProfiles;
3434
import org.springframework.test.context.aot.DisabledInAotMode;
3535
import org.springframework.web.client.RestTemplate;
36-
import org.testcontainers.containers.MySQLContainer;
3736
import org.testcontainers.junit.jupiter.Container;
3837
import org.testcontainers.junit.jupiter.Testcontainers;
38+
import org.testcontainers.mysql.MySQLContainer;
3939
import org.testcontainers.utility.DockerImageName;
4040

4141
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@@ -47,7 +47,7 @@ class MySqlIntegrationTests {
4747

4848
@ServiceConnection
4949
@Container
50-
static MySQLContainer<?> container = new MySQLContainer<>(DockerImageName.parse("mysql:9.2"));
50+
static MySQLContainer container = new MySQLContainer(DockerImageName.parse("mysql:9.5"));
5151

5252
@LocalServerPort
5353
int port;

src/test/java/org/springframework/samples/petclinic/MysqlTestApplication.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.springframework.context.annotation.Bean;
2222
import org.springframework.context.annotation.Configuration;
2323
import org.springframework.context.annotation.Profile;
24-
import org.testcontainers.containers.MySQLContainer;
24+
import org.testcontainers.mysql.MySQLContainer;
2525
import org.testcontainers.utility.DockerImageName;
2626

2727
/**
@@ -35,8 +35,8 @@ public class MysqlTestApplication {
3535
@ServiceConnection
3636
@Profile("mysql")
3737
@Bean
38-
static MySQLContainer<?> container() {
39-
return new MySQLContainer<>(DockerImageName.parse("mysql:9.2"));
38+
static MySQLContainer container() {
39+
return new MySQLContainer(DockerImageName.parse("mysql:9.5"));
4040
}
4141

4242
public static void main(String[] args) {

0 commit comments

Comments
 (0)