Spring Boot - Validations stopped working after upgrade from 2.2.5 to 2.3.0
According to spring boot 2.3.1 release there is no longer contains spring-boot-starter-validation with spring starter
how to add starter validation on
maven
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
Gradle
dependencies {
...
implementation 'org.springframework.boot:spring-boot-starter-validation'
}
referee the release note
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.3-Release-Notes#validation-starter-no-longer-included-in-web-starters
Validation starter not included in web starters anymore.
The spring-boot-starter-validation is not a transitive dependency of spring-boot-starter-web and spring-boot-starter-webflux anymore.
Add this dependency for validations work.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>