看到这个答案:https ://stackoverflow.com/a/3989936/325742
要解决此问题,请添加此 maven 依赖项 Hibernate Validator Annotation Processor。
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-annotation-processor</artifactId>
<version>4.1.0.Final</version>
</dependency>
这是该工件的最新稳定版本,从这里可以看出
查找依赖项的通用方法
假设你得到了NoClassDefFoundError
一个说明org.postgresql.Driver
找不到类的 aa。
使用 Jarvana 搜索可以org.postgresql.Driver
像这样提供的依赖项:http ://www.jarvana.com/jarvana/search?search_type=class&java_class=org.postgresql.Driver它给出

将上述依赖转换为 maven 依赖格式:
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901.jdbc4</version>
</dependency>
通过像这样搜索确认以上内容在 Maven Central 中可用:(
其中代表 GroupID 和代表 artifactID)
g:"postgresql" AND a:"postgresql"
g
a
最后,将其添加到您的 pom.xml
使用 m2e 查找依赖项
如果您对所需的依赖有一个大致的了解,或者可以通过列表找出您需要的依赖,那么m2e的依赖搜索可能是向您的 pom.xml 添加依赖的最快方法
脚步 :
- 单击 pom.xml 中的 Dependencies 选项卡 (A)
- 点击添加 (B)
- 按 groupId/artifactId 搜索依赖项 (C)
- 双击搜索结果中所需的一项,将其直接添加到您的 pom.xml (D)
AD 标记在以下快照中:

在 IntelliJ Idea 中查找依赖项
在 IntelliJ 中,查找依赖项要容易得多。您需要做的就是确保 Maven 中央存储库已被 IntelliJ 索引,如下所示:

然后,进入 pom,做一个dep+ Tab(或一个Alt+ Insert,如图所示),这就是你得到的:

如果您在一个具有未解决导入的类中,那么快速修复为您提供了一个选项,通过在缺少的类/包上
执行Alt+来搜索和添加相应的 maven 存储库:Enter
真棒我说!