开发Spring roo项目后,我在类中发现以下错误:
The import javax.validation.constraints.NotNull cannot be resolved
NotNull cannot be resolved to a type
我在用STS 3.1.0.RELEASE
如何纠正这个问题?
我有同样的问题。我发现最新版本的 Spring Boot 需要单独的依赖项来进行验证。我尝试在 pom.xml 文件中添加以下依赖项,它起作用了。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)