Cannot find dependency of "org.eclipse.persistence" on Maven

I installed Eclipse Helios with the meclipse maven plugin.

I want to create an application using JPA. So what I do: New> Maven Project, then I choose the default maven archetype.

The problem is that I want to add the dependency "org.eclipse.persistence", which I cannot find. Where is it? Can we add it manually? Should I update some kind of "repository"?

Then, is this the correct archetype that I use?

+4
source share
3 answers

EclipseLink is not available in the central Maven repository, you need to add its repository manually. For example, to use the "full" version of EclipseLink 2.0 (you did not specify the artifact you are looking for):

<dependencies> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>eclipselink</artifactId> <version>2.0.0</version> <scope>compile</scope> ... </dependency> <dependencies> ... <repositories> <repository> <id>EclipseLink Repo</id> <url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url> </repository> ... </repositories> 

This is described on the EclipseLink / Maven page.

As for the archetype you are using, it is impossible to answer without additional information about the project that you want to create. In general, you can always change the POM after the facts.

+3
source
 <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>javax.persistence</artifactId> <version>2.0.0</version> <scope>compile</scope> </dependency> ... <repositories> <repository> <url>http://repo.maven.apache.org/maven2</url> </repository> </repositories> 
+1
source

You can check the link below. I found the Eclipse JAR at this link.

However, I do not know how to add it to the Nexus.

http://dev.nightlabs.org/maven-repository/repo/

+1
source

Source: https://habr.com/ru/post/1313926/


All Articles