SpringBoot项目启动报错:The Bean Validation API is on the classpath but no implementation could be found
报错如下:
Description:
The Bean Validation API is on the classpath but no implementation could be found
Action:
Add an implementation, such as Hibernate Validator, to the classpath
尝试过mvn clean\mvn install,都没生效
也尝试过换jdk版本,也不行。
解决办法如下:
pom文件中增加spring-boot-starter-validation依赖;
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>