JAVA-22499 | Upgraded spring-boot and removed hybernate-validator to use 3.0.0.Final version of the spring-boot 3 (#14315)

This commit is contained in:
Gaetano Piazzolla 2023-06-27 12:51:25 +02:00 committed by GitHub
parent be37c06262
commit e3058691b2
16 changed files with 45 additions and 67 deletions

View File

@ -14,26 +14,6 @@
</parent> </parent>
<dependencies> <dependencies>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>${javax.el.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId> <artifactId>spring-boot-starter-validation</artifactId>
@ -58,11 +38,7 @@
<!--</plugin> </plugins> </build> --> <!--</plugin> </plugins> </build> -->
<properties> <properties>
<hibernate-validator.version>6.2.3.Final</hibernate-validator.version> <spring.boot.version>3.0.4</spring.boot.version>
<hibernate-validator.ap.version>6.2.0.Final</hibernate-validator.ap.version>
<javax.el.version>3.0.0</javax.el.version>
<org.springframework.version>5.3.21</org.springframework.version>
<spring.boot.version>2.7.1</spring.boot.version>
</properties> </properties>
</project> </project>

View File

@ -1,11 +1,13 @@
package com.baeldung.javaxval.hibernate.validator.ap; package com.baeldung.javaxval.hibernate.validator.ap;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Past;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
public class Message { public class Message {

View File

@ -1,8 +1,8 @@
package com.baeldung.javaxval.messageinterpolator; package com.baeldung.javaxval.messageinterpolator;
import javax.validation.constraints.Email; import jakarta.validation.constraints.Email;
import javax.validation.constraints.Min; import jakarta.validation.constraints.Min;
import javax.validation.constraints.Size; import jakarta.validation.constraints.Size;
public class Person { public class Person {

View File

@ -2,10 +2,10 @@ package com.baeldung.javaxval.methodvalidation.constraints;
import java.time.LocalDate; import java.time.LocalDate;
import javax.validation.ConstraintValidator; import jakarta.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext; import jakarta.validation.ConstraintValidatorContext;
import javax.validation.constraintvalidation.SupportedValidationTarget; import jakarta.validation.constraintvalidation.SupportedValidationTarget;
import javax.validation.constraintvalidation.ValidationTarget; import jakarta.validation.constraintvalidation.ValidationTarget;
@SupportedValidationTarget(ValidationTarget.PARAMETERS) @SupportedValidationTarget(ValidationTarget.PARAMETERS)
public class ConsistentDateParameterValidator implements ConstraintValidator<ConsistentDateParameters, Object[]> { public class ConsistentDateParameterValidator implements ConstraintValidator<ConsistentDateParameters, Object[]> {

View File

@ -8,8 +8,8 @@ import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import javax.validation.Constraint; import jakarta.validation.Constraint;
import javax.validation.Payload; import jakarta.validation.Payload;
@Constraint(validatedBy = ConsistentDateParameterValidator.class) @Constraint(validatedBy = ConsistentDateParameterValidator.class)
@Target({ METHOD, CONSTRUCTOR }) @Target({ METHOD, CONSTRUCTOR })

View File

@ -8,8 +8,8 @@ import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import javax.validation.Constraint; import jakarta.validation.Constraint;
import javax.validation.Payload; import jakarta.validation.Payload;
@Constraint(validatedBy = ValidReservationValidator.class) @Constraint(validatedBy = ValidReservationValidator.class)
@Target({ METHOD, CONSTRUCTOR }) @Target({ METHOD, CONSTRUCTOR })

View File

@ -2,8 +2,8 @@ package com.baeldung.javaxval.methodvalidation.constraints;
import java.time.LocalDate; import java.time.LocalDate;
import javax.validation.ConstraintValidator; import jakarta.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext; import jakarta.validation.ConstraintValidatorContext;
import com.baeldung.javaxval.methodvalidation.model.Reservation; import com.baeldung.javaxval.methodvalidation.model.Reservation;

View File

@ -1,7 +1,7 @@
package com.baeldung.javaxval.methodvalidation.model; package com.baeldung.javaxval.methodvalidation.model;
import javax.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import javax.validation.constraints.Size; import jakarta.validation.constraints.Size;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;

View File

@ -2,8 +2,8 @@ package com.baeldung.javaxval.methodvalidation.model;
import java.time.LocalDate; import java.time.LocalDate;
import javax.validation.Valid; import jakarta.validation.Valid;
import javax.validation.constraints.Positive; import jakarta.validation.constraints.Positive;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;

View File

@ -3,11 +3,11 @@ package com.baeldung.javaxval.methodvalidation.model;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
import javax.validation.Valid; import jakarta.validation.Valid;
import javax.validation.constraints.Future; import jakarta.validation.constraints.Future;
import javax.validation.constraints.Min; import jakarta.validation.constraints.Min;
import javax.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import javax.validation.constraints.Size; import jakarta.validation.constraints.Size;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;

View File

@ -1,9 +1,9 @@
package com.baeldung.javaxval.notnull; package com.baeldung.javaxval.notnull;
import javax.validation.Validation; import jakarta.validation.Validation;
import javax.validation.Validator; import jakarta.validation.Validator;
import javax.validation.ValidatorFactory; import jakarta.validation.ValidatorFactory;
import javax.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
public class NotNullMethodParameter { public class NotNullMethodParameter {

View File

@ -1,6 +1,6 @@
package com.baeldung.javaxval.notnull; package com.baeldung.javaxval.notnull;
import javax.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;

View File

@ -4,10 +4,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Set; import java.util.Set;
import javax.validation.ConstraintViolation; import jakarta.validation.ConstraintViolation;
import javax.validation.Validation; import jakarta.validation.Validation;
import javax.validation.Validator; import jakarta.validation.Validator;
import javax.validation.ValidatorFactory; import jakarta.validation.ValidatorFactory;
import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator;
import org.junit.BeforeClass; import org.junit.BeforeClass;

View File

@ -3,7 +3,7 @@ package com.baeldung.javaxval.methodvalidation;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
import javax.validation.ConstraintViolationException; import jakarta.validation.ConstraintViolationException;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;

View File

@ -8,10 +8,10 @@ import java.time.LocalDate;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import javax.validation.ConstraintViolation; import jakarta.validation.ConstraintViolation;
import javax.validation.Validation; import jakarta.validation.Validation;
import javax.validation.ValidatorFactory; import jakarta.validation.ValidatorFactory;
import javax.validation.executable.ExecutableValidator; import jakarta.validation.executable.ExecutableValidator;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;

View File

@ -6,9 +6,9 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Set; import java.util.Set;
import javax.validation.ConstraintViolation; import jakarta.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException; import jakarta.validation.ConstraintViolationException;
import javax.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;