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
new to this and playing around with it. I don't have a complete solution BUT:
It seemed like I was able to resolve a few dependencies by including http://repository.jboss.com/maven3/ instead of maven 2.
for those that remain problematic, one can as a last straw download the missing files from the maven site, for example, browse:
http://repo1.maven.org/maven2/org/hibernate/hibernate-core/3.6.8.Final/
(yes, i tried setting this and other reasonable paths as a repository source, but without success...)
to install this jar into your maven build, do something like:
mvn install:install-file -Dfile=path/to/jar/hibernate-core-3.6.8.Final.jar -DgroupId=org.hibernate -DartifactId=hibernate-core -Dversion=3.6.8-Final -Dpackaging=jar
reference:http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
sorry, just realized some of this is redundant, but hope it's helpful to some to see the additional possible URLs. - JB
It's frustrating, but the newer versions just aren't there, and haven't been for a long time. The irony is that the Hibernate artifacts have some fairly intricate inter-dependencies and well-documented minimum versions of those dependencies, which would be ideally represented as a Maven POM. Instead, we have to download the binaries ourselves and try and express them locally.
the jars are missing in the repository, maybe that is the reason the latest hibernate version is not in the main repoistory
You're having problems because org.hibernate:hibernate:3.3.2.GA is an aggregator POM used to build the rest of the modules, it isn't actually a jar. It looks like a refactoring happened after 3.2.7 and that's thrown people off. For reference this blog entry hints at problems they've had promoting Hibernate to central and may explain the change.
If you look in the JBoss repository, you'll see that the hibernate modules for 3.3.2.GA are hosted, they're just hosted as individual artifacts, hibernate-core, hibernate-ehcache etc. So your repository declaration is correct, you just need to fine tune the dependency declarations to take the change into account.
The JBoss repository hosts hibernate-annotations-3.4.0.GA, hibernate-validator-3.1.0.GA, and hibernate-core-3.3.2.GA amongst others. Try adding the specific artifacts to your POM and use the JBoss repository as you've already declared.
There is also a hibernate-dependencies pom that provides transitive dependencies to the majority of hibernate artifacts (including core). So the simplest thing to do would be to replace your existing hibernate dependency declaration with hibernate-dependencies
Your dependencies would end up like this...
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-dependencies <!--or hibernate-core--></artifactId>
<version>3.3.2.GA</version>
<type>pom</type>
<!--hibernate-dependencies is a pom, not needed for hibernate-core-->
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>3.1.0.GA</version>
</dependency>
...
<!--any other hibernate deps not inherited transitively-->
To make your life simpler you could define all these hibernate dependencies in a project say called (hibernate-all), then reference that single project for all your projects that use hibernate (of course it would be nice if the hibernte team provided that project anyway).
You can use dependance in your pom.xml
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.6.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.1.GA</version>
</dependency>
This question is outdated since a long time now: all Hibernate releases are available in Maven central since years.
Check www.hibernate.org for latest Maven coordinates (do not trust your IDE's suggestions).