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

12,357

Solution 1

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.

Solution 2

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>

Solution 3

You need to set the default builder in your project to be maven.

To do so, right click on your project and select Properties (or select the project and press the alt+enter keys on your keyboard)

In the dialog, on the left, select Builders.

On the right, select the Maven Project Builder, and using the Up button on the right advance it to the top of the list.

Click Ok and you are done.

EDIT:

To fix the issue that you've described, you'll need to go to the root folder of your application. Find the following two files: .project and .classpath

You will need to edit them, so exit eclipse and back those files up.

In .project, change the following lines:

  1. In the build command that relates to maven, change the value of the name tag to: org.eclipse.m2e.core.maven2Builder
  2. In nature, change it to: org.eclipse.m2e.core.maven2Nature

In .classpath, change the following lines:

  1. <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/> to <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>

Hope it helps.

Share:
12,357
CodeMed
Author by

CodeMed

Updated on September 14, 2022

Comments

  • CodeMed
    CodeMed over 1 year

    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.

    • BoatCode
      BoatCode almost 10 years
      I just had a similar problem (hibernate 3.3.2.GA, not the entitymanager) and noticed mvnrepository.com lists the binary file as being 0bytes... which would explain why it seems to be missing from my project.
  • Ralph
    Ralph over 10 years
    @CodeMed see my extended answer
  • CodeMed
    CodeMed over 10 years
    +1 for going the extra mile. Thank you. But I did as you suggested, and eclipse still throws the same error. I confirmed that the .m2 subdirectory now reads only 3.3.2.GA, and I even closed then restarted eclipse kepler, yet the error message is still there. Any other ideas?
  • CodeMed
    CodeMed over 10 years
    +1 for helping me dig deeper. Thank you. I opened the list of builders in eclipse and the top listing is "Missing builder (org.maven.ide.eclipse.maven2Builder)". But clicking "New..." or "Import..." in that dialog box does not lead to an intuitive next step. (Note that the .m2 folder got rebuilt with 3.3.2.GA anyway.) Do you have any suggestions?
  • CodeMed
    CodeMed over 10 years
    +1 Thanks for helping. See my edit to my original posting above.