我无法通过 Maven 依赖项获取最新版本的 Hibernate。看来我可以从 Maven 中央存储库获取的最新版本是 3.2.6.GA,我有兴趣使用 3.3.2.GA,这是 hibernate.org 网站上显示的最新版本。当我在我的项目的 pom.xml 中将我的休眠依赖项修改为这个最新版本时,我在运行 Maven 构建时收到以下错误:
Missing:
----------
1) org.hibernate:hibernate:jar:3.3.2.GA
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.hibernate -DartifactId=hibernate -D
version=3.3.2.GA -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.hibernate -DartifactId=hibernate -Dve
rsion=3.3.2.GA -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[
id]
一旦我这样做了,我会继续收到错误消息,表明我需要添加一个 javassist 依赖项,然后我需要更新我的 hibernate-validator 依赖项,它也需要在本地安装,然后我停下来环顾四周,看看是否有更好的方法,可能将 Maven 指向 JBoss/Hibernate 存储库等。与我使用的其他重要的开源软件包(如 Spring 或 JUnit)相比,这似乎真的很让人头疼——当有一个新版本发布时,我做的是更新依赖元素中的版本号,它就可以工作。
我尝试将以下存储库声明添加到我的 pom.xml 中,但没有任何乐趣:
<repositories>
<repository>
<id>jboss</id>
<url>http://repository.jboss.org/maven2</url>
</repository>
</repositories>
我搜索了谷歌并没有找到太多帮助。有人可以建议使用最新版本的 hibernate 或 hibernate-core (3.3.2.GA)、hibernate-validator (3.1.0) 和 hibernate-annotations (3.4.0) 的最直接的方法吗?