I currently have a java/spring-boot application where I changed the version (in code) from 2.1.4 to 2.3.0 but as a result I've come across the error error: package javax.validation.constraints does not exist
when trying to run a clean build - this comes from a import javax.validation.constraints.NotEmpty;
line I have in my code - does anyone know how to resolve this issue to the code compiles/builds successfully?
The Validation Starter dependency is no longer included in the web starter dependencies. Therefore you need to add it manually to your gradle file:
implementation 'org.springframework.boot:spring-boot-starter-validation'
This is mentioned in the release notes:
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.3.0-M1-Release-Notes#validation-starter-no-longer-included-in-web-starters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With