Can't find the “org.eclipse.persistence” Maven dependency

匆匆过客 提交于 2019-12-13 13:27:31

问题


I installed Eclipse Helios with the m2eclipse maven plugin.

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

The problem is that I want to add the "org.eclipse.persistence" dependency that I can't find. Where is it? Can we add it manually? Should I update a sort of "repository"?

Then, is it the right archetype that I'm using?


回答1:


EclipseLink is not available in Maven central repository, you need to add its repository manually. For example, to use the "full" version of EclipseLink 2.0 (you didn't mention the artifact you're 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 documented in the EclipseLink/Maven page.

Regarding the archetype you're using, it's impossible to answer without more details on the kind of project you want to create. And anyway, you can always modify the POM after the facts.




回答2:


<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> 



回答3:


You can check below link. I found eclipse JARs on this link.

However, no idea about how to add it on Nexus.

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



来源:https://stackoverflow.com/questions/3122135/cant-find-the-org-eclipse-persistence-maven-dependency

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!