Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

artifact missing: org.hibernate:hibernate-entitymanager:jar:3.3.2.ga

I am relatively new to Spring and maven, and am just revisiting both of them for the first time in a couple months. I am encountering the following error in pom.xml when I try to run code from this tutorial:

Missing artifact: org.hibernate:hibernate-entitymanager:jar:3.3.2.ga  

Does this mean that I have to download and install an additional jar? I am pretty sure that I downloaded hibernate with spring, and this is supported by the fact that the spring pet clinic sample application runs fine on my system when launched from eclipse on tomcat server.

I have done google searches for this error message, and have tried many of the suggestions, but they have not fixed the problem on my machine. How can I get past this error message?


EDIT/ANSWER?

I dug into the directory structure of the project, and found another copy of pom.xml which did not throw the error. It actually used the syntax 3.3.2.ga, so I do not think that case was the problem. The new pom.xml file was located deep in the target/m2e-wtp/web-resources/META-INF/Maven/MavenWeb/MavenWeb/ subdirectory. When I moved this new pom.xml to the root directory, the error message went away, even though the syntax of the node was still:

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>3.3.2.ga</version>
</dependency>  

For the moment, this question is answered, at least until I try to run it later. Let me think about how to give credit for the work people did on this while still leaving the answer clear to people who find this on the search engines.

like image 813
CodeMed Avatar asked Nov 18 '13 21:11

CodeMed


2 Answers

Maven will download the required jars form the maven central repository automatically.

But I have not found org.hibernate:hibernate-entitymanager:jar:3.3.2.ga at maven central but instead one with Version 3.3.2.GA with upper case GA! :

<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-entitymanager</artifactId>
  <version>3.3.2.GA</version>
</dependency>

On windows you while have an other problem (because the windows file system does not distinguish between upper case and lower case file names): You will need to delete a directory:

c:\documents\<yourName>\.m2\repository\org\hibernate\hibernate-entitymanager\3.3.2.ga\

delete this directory and the try again eclipse update maven dependencies.

like image 104
Ralph Avatar answered Sep 28 '22 03:09

Ralph


You may have downloaded the hibernate as you described but it may have been the incorrect version. Anyways, make sure you change pom.xml file, where you are defining hibernate-entitymanager to look like below lines. (because that's the exact version it will look for)

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>3.3.2.GA</version>
</dependency>
like image 32
grepit Avatar answered Sep 28 '22 03:09

grepit