JPA(2.1) dependency on POM.xml file

Asked

Viewed 1,248 times

1

I did a normal Javase project with JPA for the persistence part, and it worked, the project consists only of an entity that is persisted in the bank and nothing else. I used the following libraries:

  • Eclipselink(JPA 2.1) - eclipselink.jar
  • Eclipselink(JPA 2.1) - javax.persistence_2. 1.0v201304241213.jar
  • Eclipselink(JPA 2.1) -org.eclipse.persistence.jpa.jpql_2. 5.2v20140319-9ad6abd.jar
  • Postgressql -postgresql-92-1002.jdbc4.jar JDBC driver

    But when I tried to do the same Java project on Maven, it gave a zebra, I can’t put all dependencies!.
    Here’s an excerpt from the dependencies I was able to find:

     <dependencies>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
            <version>2.1.0</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.2-1002-jdbc4</version>
        </dependency>
      </dependencies>
    

But the other two libraries are still missing. What should I do?

This error always appears when I try to run the project:

Failed to execute Goal on project JPA_TESTE: Could not resolve dependencies for project example.jpa:JPA_TESTE:jar:1.0: Failure to find org.eclipse.persistence:eclipselink:jar:2.1 in http://repo.maven.apache.org/maven2 was cached in the local Repository, Resolution will not be reattempted until the update interval of central has Elapsed or updates are Forced -> [Help 1]

I am using netbeans and trying to do a javaSE Maven project the full application is on github.

  • 1

    See if it helps you: http://stackoverflow.com/questions/3003421/how-to-setup-eclipselink-with-jpa

1 answer

1


See if these are the ones you want.

<dependency>
    <groupId>org.eclipse.persistence</groupId>
    <artifactId>org.eclipse.persistence.jpa.jpql</artifactId>
    <version>2.5.0</version>
</dependency>

<dependency>
    <groupId>org.eclipse.persistence</groupId>
    <artifactId>eclipselink</artifactId>
    <version>2.0.0</version>
  </dependency>
  • The second gives us to try another dependency. Wait a minute.

  • 1

    Try changing the eclipselink version to <version>2.5.0</version>. See if it works.

  • 1

    If applicable, lower the jar here: http://mvnrepository.com/artifact/org.eclipse.persistence/eclipselink/2.5.0

  • 1

    And then it worked?

  • But you even downloaded the jar in the link I showed you? If it is only the jar of eclipselink that is missing, you will solve by downloading. Of course after downloading, you have to put in the eclipse path.

  • I use netbeans and already downloaded all dependencies!! Even gave an error!! is a javaSE application with Maven !

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.