Tanzeel
Tanzeel

Reputation: 5018

How to resolve Maven dependency for Hibernate in NetBEans 12.4

I'm learning Hibernate. This is my day 1 and I'm watching this video on YouTube: Hibernate Tutorial | Practical. I did exactly what the tutor said but my program is not able to recognize:

import org.hibernate.Session;
import org.hibernate.SessionFactory;

It says: Package org.hibernate does not exists.

Here is my pom.xml

...
<dependencies>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.26</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>4.1.6.Final</version>
    </dependency>
</dependencies>

Here is the screenshot:

enter image description here

I can see hibernate-core-5.5.6.Final.jar on the left panel but when I hover on that, the tooltip says:

Dependency not yet downloaded. Build project to correct errors.

Yes, I Clean-Build it again and again. I googled a lot but none of the answer is working. Please help.

Upvotes: 0

Views: 1548

Answers (1)

vichchu16 s
vichchu16 s

Reputation: 1

I got same problem. I tried to add the hibernate dependency by right clicking on the Dependencies under projects tab-> add dependency and it resolved the error. NetBeans Version IDE :18 I added below dependency.

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

Upvotes: 0

Related Questions