我如何使用Maven获取最新的Hibernate版本? [英] How can I use Maven to get the latest Hibernate release?

查看:189
本文介绍了我如何使用Maven获取最新的Hibernate版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法通过Maven依赖关系获取最新版本的Hibernate。看起来,我可以从Maven中央存储库中获取的最新版本是3.2.6.GA,并且我有兴趣使用3.3.2.GA,它是hibernate.org网站上显示的最新版本。当我在我的项目的pom.xml中将我的hibernate依赖项修改为最新版本时,当我运行Maven构建时,出现以下错误:

 丢失:
----------
1)org.hibernate:hibernate:jar:3.3.2.GA

尝试手动下载文件来自项目网站。

然后,使用以下命令安装它:
mvn install:install-file -DgroupId = org.hibernate -DartifactId = hibernate -D
version = 3.3.2.GA - Dpackaging = jar -Dfile = / path / to / file

或者,如果您托管自己的存储库,则可以在其中部署文件:

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)相比,它似乎令人头疼 - 当有新版本发布时我所做的只是更新dependency元素中的版本号,并且它正常工作。



我曾尝试将下面的存储库声明添加到我的pom.xml中,但没有任何喜悦:

 < repositories> 
< repository>
< id> jboss< / id>
< url> http://repository.jboss.org/maven2< / url>
< / repository>
< / repositories>

我搜索了Google并没有找到太多帮助。有人可以建议使用最新版本的hibernate或hibernate-core(3.3.2.GA),hibernate-validator(3.1.0)和hibernate-annotations(3.4.0)的最直接的方法吗?

解决方案

JBoss已经开始将自己的回购与Maven central同步为张贴在JBoss社区博客上,因此 hibernate <现在可以使用code> artifacts,而无需将JBoss存储库添加到 pom.xml 或存储库管理器中。



hibernate-core的搜索结果





要将Hibernate Core 3.6.3添加到您的项目中,只需将以下代码片段添加到您的pom中:

 < dependency> 
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-core< / artifactId>
< version> 3.6.3.Final< / version>
< /依赖关系>


I am having trouble getting the latest release of Hibernate via Maven dependency. It appears that the latest I can fetch from a Maven central repository is 3.2.6.GA, and I am interested in using 3.3.2.GA, which is the latest release shown on the hibernate.org site. When I modify my hibernate dependency to this latest version in my project's pom.xml I get the following error when I run a Maven build:

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]

Once I do that I continue to get errors indicating that I need to add a javassist dependency, then I need to update my hibernate-validator dependency, which also needs to be installed locally, and at that point I stopped and looked around to see if there is a better way, maybe pointing Maven to a JBoss/Hibernate repository, etc. This really seems to be a headache compared to other significant open cource packages that I use such as Spring or JUnit -- when there's a new version released all I do is update the version number in the dependency element and it just works.

I have tried adding the below repository declaration into my pom.xml but with no joy:

<repositories>
    <repository>
        <id>jboss</id>
        <url>http://repository.jboss.org/maven2</url>
    </repository>
</repositories>

I searched Google and didn't find much which helps. Can someone suggest the most straight-forward way of going about using the latest releases of hibernate or hibernate-core (3.3.2.GA), hibernate-validator (3.1.0), and hibernate-annotations (3.4.0)?

解决方案

JBoss have started synchronising their own repo with Maven central as posted on the JBoss community blog , therefore hibernate artifacts are now available without the need to add the JBoss repository to your pom.xml or repository manager.

Search result for hibernate-core:

To add the Hibernate Core 3.6.3 to your project, just add the following snippet to your pom:

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>3.6.3.Final</version>
</dependency>

这篇关于我如何使用Maven获取最新的Hibernate版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆