From 8ed306c215aa8020b51e530e370fd1d4f4b8306f Mon Sep 17 00:00:00 2001 From: Maciej Walkowiak Date: Tue, 28 Mar 2023 07:14:13 +0200 Subject: [PATCH] Upgrade to Spring Boot 3.0 (#16) --- pom.xml | 10 ++++---- .../samples/petclinic/owner/Owner.java | 4 ++-- .../petclinic/owner/OwnerController.java | 3 +-- .../petclinic/owner/PetController.java | 2 +- .../petclinic/owner/VisitController.java | 2 +- .../samples/petclinic/vet/Vet.java | 2 +- .../samples/petclinic/visit/Visit.java | 2 +- .../resources/templates/fragments/layout.html | 24 +++++++++---------- .../petclinic/model/ValidatorTests.java | 4 +--- 9 files changed, 25 insertions(+), 28 deletions(-) diff --git a/pom.xml b/pom.xml index f1a16f80..f35e1b50 100644 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ 4.0.0 org.springframework.samples spring-petclinic-data-jdbc - 2.1.0.BUILD-SNAPSHOT + 3.0.0.BUILD-SNAPSHOT org.springframework.boot spring-boot-starter-parent - 2.7.5 + 3.0.5 petclinic @@ -64,7 +64,7 @@ org.testcontainers mysql - 1.17.4 + 1.17.6 test @@ -168,8 +168,8 @@ - pl.project13.maven - git-commit-id-plugin + io.github.git-commit-id + git-commit-id-maven-plugin diff --git a/src/main/java/org/springframework/samples/petclinic/owner/Owner.java b/src/main/java/org/springframework/samples/petclinic/owner/Owner.java index 3070cc19..83f6e1ce 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/Owner.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/Owner.java @@ -15,8 +15,8 @@ */ package org.springframework.samples.petclinic.owner; -import javax.validation.constraints.Digits; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.Digits; +import jakarta.validation.constraints.NotEmpty; import org.springframework.data.annotation.Id; /** diff --git a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java index d1aad320..21ccb8c1 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java @@ -15,11 +15,10 @@ */ package org.springframework.samples.petclinic.owner; -import java.util.Collection; +import jakarta.validation.Valid; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import javax.validation.Valid; import org.springframework.samples.petclinic.visit.Visit; import org.springframework.samples.petclinic.visit.VisitRepository; import org.springframework.stereotype.Controller; diff --git a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java index 3924915b..44e55ad0 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java @@ -15,8 +15,8 @@ */ package org.springframework.samples.petclinic.owner; +import jakarta.validation.Valid; import java.util.Collection; -import javax.validation.Valid; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.util.StringUtils; diff --git a/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java b/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java index 58d07667..f098f084 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java @@ -15,8 +15,8 @@ */ package org.springframework.samples.petclinic.owner; +import jakarta.validation.Valid; import java.util.Map; -import javax.validation.Valid; import org.springframework.samples.petclinic.visit.Visit; import org.springframework.samples.petclinic.visit.VisitRepository; import org.springframework.stereotype.Controller; diff --git a/src/main/java/org/springframework/samples/petclinic/vet/Vet.java b/src/main/java/org/springframework/samples/petclinic/vet/Vet.java index d242a56a..06681b74 100644 --- a/src/main/java/org/springframework/samples/petclinic/vet/Vet.java +++ b/src/main/java/org/springframework/samples/petclinic/vet/Vet.java @@ -15,13 +15,13 @@ */ package org.springframework.samples.petclinic.vet; +import jakarta.validation.constraints.NotEmpty; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.validation.constraints.NotEmpty; import org.springframework.data.annotation.Id; /** diff --git a/src/main/java/org/springframework/samples/petclinic/visit/Visit.java b/src/main/java/org/springframework/samples/petclinic/visit/Visit.java index 9d908b7a..9988915c 100755 --- a/src/main/java/org/springframework/samples/petclinic/visit/Visit.java +++ b/src/main/java/org/springframework/samples/petclinic/visit/Visit.java @@ -15,8 +15,8 @@ */ package org.springframework.samples.petclinic.visit; +import jakarta.validation.constraints.NotEmpty; import java.time.LocalDate; -import javax.validation.constraints.NotEmpty; import org.springframework.data.annotation.Id; import org.springframework.format.annotation.DateTimeFormat; diff --git a/src/main/resources/templates/fragments/layout.html b/src/main/resources/templates/fragments/layout.html index b2ca059c..b0404cb0 100755 --- a/src/main/resources/templates/fragments/layout.html +++ b/src/main/resources/templates/fragments/layout.html @@ -36,42 +36,42 @@
- - + +

diff --git a/src/test/java/org/springframework/samples/petclinic/model/ValidatorTests.java b/src/test/java/org/springframework/samples/petclinic/model/ValidatorTests.java index 31d69d30..76918c2f 100644 --- a/src/test/java/org/springframework/samples/petclinic/model/ValidatorTests.java +++ b/src/test/java/org/springframework/samples/petclinic/model/ValidatorTests.java @@ -17,10 +17,8 @@ import static org.assertj.core.api.Assertions.assertThat; +import jakarta.validation.Validator; import java.util.Locale; -import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.Validator; import org.junit.jupiter.api.Test; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.samples.petclinic.owner.Owner;