views:

97

answers:

1

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?

A: 

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;amp;nf=1&amp;amp;file=/rt/eclipselink/maven.repo&lt;/url&gt;
  </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.

Pascal Thivent
I just ran into what could be considered a related problem. It appears that not all Eclipse mirrors have all versions of EclipseLink. Right now, 2.1.1 is the latest version of EclipseLink, but I've only been able to get 2.0.2 reliably from Eclipse's Maven mirrors.
R. Bemrose
@R. Bemrose Declaring a mirror having the dependencies might help in that case (loosing the advantage of a mirror). But that's more a EclipseLink mirror issue.
Pascal Thivent