首页 > 编程语言 > springboot2.3之后hibernate-validator依赖缺失【踩坑】
2020
11-29

springboot2.3之后hibernate-validator依赖缺失【踩坑】

springboot2.3之后,hibernate-validator依赖缺失

今天在写项目的时候,发现@Blank注解没有了,检查了一下,发现老版本springboot内集成的hibernate-validator依赖已经去掉了

如图,当前版本2.4.0的spring-boot-starter-web包

2.4.0

版本2.1.3

2.1.3

在网上查阅了一下:

官方解释

解决方法:

在pom文件里手动加入依赖

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation -->
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-validation</artifactId>
  <version>2.3.5.RELEASE</version>
</dependency>

到此这篇关于springboot2.3之后hibernate-validator依赖缺失【踩坑】的文章就介绍到这了,更多相关springboot hibernate-validator依赖缺失内容请搜索自学编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持自学编程网!

编程技巧