如何在IntelliJ中导入javax.validation以供使用?

huangapple go评论57阅读模式
英文:

How to import javax.validation to use in IntelliJ?

问题

有谁知道如何在IntelliJ中使用javax.validation包?我正在使用Gradle,但这个包不会像我使用的其他所有内容一样自动导入。我还尝试从jar网站下载它,但也没有成功。我的Gradle项目,在与javax.validation相关的任何内容上显示“无法解析的符号”

英文:

Does anyone know how to use the javax.validation package in IntelliJ? I'm using Gradle, the package won't auto import like everything else I use. I also tried downloading it from a jar website but that didn't work either.My Gradle project, "cannot resolve symbol" on anything related to javax.validation

答案1

得分: 0

在最新版本的Spring Boot中,验证功能已移至另一个Spring Boot starter库中,您需要引入:

> implementation 'org.springframework.boot:spring-boot-starter-validation'

这样应该可以工作。

英文:

In the latest version of spring boot the validation was moved to another spring boot starter lib, you need to import:

> implementation 'org.springframework.boot:spring-boot-starter-validation'

a this should be work.

huangapple
  • 本文由 发表于 2020年10月5日 07:34:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/64200858.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定