【发布时间】:2011-03-01 23:51:00
【问题描述】:
我在将 pom 文件从 Hibernate 3.3.2 升级到 3.6.0 时遇到问题。我可以正常编译,jar 文件正在被拉下,但我收到以下错误:java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.Configuration 运行 Surefire 测试时。这个类在引用的 JAR 中,所以我不太确定这里发生了什么,除非类路径 maven 正在使用以某种方式引用错误的 jar。我清除了本地存储库缓存,但无济于事。
我的 pom 片段如下。有什么想法吗?
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.6.0.Final</version>
</dependency>
<repository>
<id>JBoss</id>
<name>JBoss repository</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss</url>
</repository>
【问题讨论】: