Merge pull request #15210 from anuragkumawat/JAVA-27194

JAVA-27194 Upgrade hibernate validator version in spring-mvc-java
This commit is contained in:
Kasra Madadipouya 2023-11-13 23:13:35 +01:00 committed by GitHub
commit 1004be18c0
6 changed files with 20 additions and 28 deletions

View File

@ -101,7 +101,6 @@
<dependency> <dependency>
<groupId>org.hibernate.validator</groupId> <groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId> <artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.glassfish</groupId> <groupId>org.glassfish</groupId>
@ -217,8 +216,6 @@
<!-- persistence --> <!-- persistence -->
<hibernate.version>6.0.10.Final</hibernate.version> <hibernate.version>6.0.10.Final</hibernate.version>
<mysql-connector-java.version>5.1.40</mysql-connector-java.version> <mysql-connector-java.version>5.1.40</mysql-connector-java.version>
<!-- various -->
<hibernate-validator.version>6.0.10.Final</hibernate-validator.version>
<!-- util --> <!-- util -->
<jsonpath.version>2.2.0</jsonpath.version> <jsonpath.version>2.2.0</jsonpath.version>
<!-- testing --> <!-- testing -->

View File

@ -10,8 +10,9 @@
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>spring-web-modules</artifactId> <artifactId>parent-spring-6</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-spring-6</relativePath>
</parent> </parent>
<dependencies> <dependencies>
@ -19,26 +20,18 @@
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId> <artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency> </dependency>
<!-- web --> <!-- web -->
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>jakarta.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>jakarta.servlet-api</artifactId>
<version>${javax.servlet-api.version}</version> <version>${jakarta.servlet-api.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
<scope>runtime</scope>
</dependency>
<dependency> <dependency>
<groupId>org.hibernate.validator</groupId> <groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId> <artifactId>hibernate-validator</artifactId>
@ -57,9 +50,9 @@
<version>${commons-io.version}</version> <version>${commons-io.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.glassfish</groupId> <groupId>org.glassfish.expressly</groupId>
<artifactId>javax.el</artifactId> <artifactId>expressly</artifactId>
<version>${javax.el.version}</version> <version>${expressly.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -98,9 +91,11 @@
<mysql-connector-java.version>5.1.40</mysql-connector-java.version> <mysql-connector-java.version>5.1.40</mysql-connector-java.version>
<httpcore.version>4.4.5</httpcore.version> <httpcore.version>4.4.5</httpcore.version>
<httpclient.version>4.5.2</httpclient.version> <httpclient.version>4.5.2</httpclient.version>
<hibernate-validator.version>6.0.10.Final</hibernate-validator.version> <hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
<javax.el.version>3.0.1-b08</javax.el.version> <expressly.version>5.0.0</expressly.version>
<cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version> <cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
<jakarta.servlet-api.version>6.0.0</jakarta.servlet-api.version>
<spring-boot-starter-test.version>3.1.5</spring-boot-starter-test.version>
</properties> </properties>
</project> </project>

View File

@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.WebRequest; import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
import javax.validation.ConstraintViolationException; import jakarta.validation.ConstraintViolationException;
@ControllerAdvice @ControllerAdvice
public class ConstraintViolationExceptionHandler extends ResponseEntityExceptionHandler { public class ConstraintViolationExceptionHandler extends ResponseEntityExceptionHandler {

View File

@ -7,11 +7,11 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.constraints.Max; import jakarta.validation.constraints.Max;
import javax.validation.constraints.Min; import jakarta.validation.constraints.Min;
import javax.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern; import jakarta.validation.constraints.Pattern;
import javax.validation.constraints.Size; import jakarta.validation.constraints.Size;
@Controller @Controller
@RequestMapping("/public/api/1") @RequestMapping("/public/api/1")

View File

@ -2,7 +2,7 @@ package com.baeldung.spring.taglibrary;
import java.util.List; import java.util.List;
import javax.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotEmpty;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;

View File

@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.validation.Valid; import jakarta.validation.Valid;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;