Search code examples
javamaven-2jpaeclipselinkm2eclipse

Can't find the "org.eclipse.persistence" Maven dependency


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?


Solution

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