Situation
Can not use Valid and Length annotation
Pom.xml
Solution
Add dependency to Pom.xml
In IntelliJ, View > Tool Windows > Maven or ‘Maven’ in right-side panel, click refresh icon
Error display disappears
Reasons for the error
The class could not be imported because there was no dependency in Pom.xml
Ref:
Spring Developing JPA-based web applications with Spring - keesun.b