我尝试将休眠依赖项添加到我的 POM 文件中,但是 antlr 版本 2.7.7 有问题。
我把它放在我的 pom 文件中:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.4.Final</version>
</dependency>
我得到的错误是
ArtifactTransferException: Failure to transfer antlr:antlr:jar:2.7.7 from http://repo1.maven.org/maven2 was cached in the local repository
我尝试通过使用排除它
<exclusions>
<exclusion>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</exclusion>
</exclusions>
,但我得到
java.lang.NoClassDefFoundError:LEntityManager