Jump to: navigation, search

Difference between revisions of "EclipseLink/Maven"

m (Fixed wrong URL)
(Issues With Nexus)
(38 intermediate revisions by 6 users not shown)
Line 1: Line 1:
== Location ==
+
<div style="float:right;width:300px"><div align="center" style="background:#ffffff;width:275px">
 +
__TOC__
 +
</div> </div>
 +
The EclipseLink project currently produces a maven repository for its releases
  
The use of the Eclipse mirrors for Maven repositories has been reported to cause varying issues from artifacts being reported as unavailable to local maven repository corruption. Therefore, instead of using the mirrored download URL:
+
<div align="center">'''http://download.eclipse.org/rt/eclipselink/maven.repo'''</div>
* http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo
+
it is recommended that you use the unmirrored URL to directly access the EclipseLink Maven repository on the Eclipse download site instead:
+
* http://download.eclipse.org/rt/eclipselink/maven.repo
+
  
== Proxying using Repository Managers (Nexus et al.) ==
+
If you have any questions about using it, or experience problems, please let us know on our users mailing list or forum.  
  
We appreciate your attempt to proxy the EclipseLink repository using a repository manager like Nexus and others. It reduces load from our servers and speeds up your local builds by reducing traffic over the web. There is work in progress to publish our releases of EclipseLink on the Eclipse Foundation's Nexus instance at http://maven.eclipse.org/nexus, but this is not finally done yet. Currently we only publish to a P2 instance directly, which is not trivial to proxy using a Maven repository manager due to technical differences, but it is possible with some helpful information:
+
== Configuring your pom.xml  ==
  
=== Using Nexus Professional ===
+
To help users diagnose Maven issues, we have created a basic POM that simply establishes EclipseLink dependencies (currenly using the 2.4.0 release). Executing it will verify your connection to the repository. Alternate Repository URLs are discussed. The POM can be found [[http://www.eclipse.org/downloads/download.php?file=/rt/eclipselink/pom.xml here]].
  
Nexus Professional natively can proxy P2 repositories. Just provide the address http://wiki.eclipse.org/EclipseLink/Maven and set the proxy type to P4. See http://www.sonatype.com/books/nexus-book/reference/p2-sect-intro.html for more details.
+
=== <repository> ===
  
=== Using Nexus Open Source ===
+
Within your pom.xml you will need to specify the EclipseLink repository using:
 +
<source lang="xml">
 +
<repository>
 +
  <id>EclipseLink</id>
 +
  <url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
 +
</repository>
 +
</source>
  
Since Nexus Open Source cannot natively proxy P2 repositories, you have to take a bit more care:
+
== <dependencies> ==
* Provider: "Maven2 Repository"
+
* Remote Storage Location: "http://download.eclipse.org/rt/eclipselink/maven.repo/"
+
* Download Remote Indexes: "False"
+
  
You will be able to download artifacts using these seetings (which is what you primarily want), but note that you will neither be able to search nor browse artifacts that have not already been downloaded into the Nexus cache. The reason is that without native P2 support, Nexus read an index or list of artifacts found in the remote P2 repository. As this is only a secondary use of a repository manager, we hope you are not too disappointed. Remember, this will work as soon as we moved over to Eclipse's Nexus instance.
+
The artifacts can then be added to you pom as follows. The complete list of available artifacts and their usage is below.
  
See http://www.sonatype.com/books/nexus-book/reference/config-sect-new-repo.html#id3046241 for more detail.
+
<source lang="xml">
 +
<dependency>\
 +
  <groupId>org.eclipse.persistence</groupId>
 +
  <artifactId>{artifact}</artifactId>
 +
  <version>{version}</version>
 +
  <scope>compile</scope>
 +
</dependency>
 +
</source>
  
== Identifiers ==
+
The following are the primary artifacts. All listed dependencies are also included in this repository.
=== Group Id: org.eclipse.persistence ===
+
  
 
{|{{BMTableStyle}}
 
{|{{BMTableStyle}}
 
|-{{BMTHStyle}}
 
|-{{BMTHStyle}}
! Artifact Id
+
! Artifact Id  
 
! Description
 
! Description
 +
! Dependencies
 +
! 2.4.0 POM
 
|-
 
|-
| javax.persistence || EclipseLink version of the javax.persistence classes (OSGi enabled)
+
| eclipselink
 +
| The full eclipselink.jar (non-OSGi) including the full capabilities of all of the following artifact bundles and fragments.
 +
| javax.persistence<br/>commonj.sdo
 +
| [http://download.eclipse.org/rt/eclipselink/maven.repo/org/eclipse/persistence/eclipselink/2.4.0/eclipselink-2.4.0.pom POM]
 
|-
 
|-
| org.eclipse.persistence.equinox || EclipseLink JPA - Equinox OSGi Fragment
+
| org.eclipse.persistence.jpa
 +
| EclipseLink JPA (OSGi bundle): Use this artifact if you only want EclipseLink's JPA capabilities for relational databases. If accessing an Oracle database then you will also want the '''org.eclipse.persistence.oracle''' artifact.
 +
| javax.persistence<br/>org.eclipse.persistence.asm<br/>org.eclipse.persistence.antlr<br/>org.eclipse.persistence.jpa.jpql<br/>org.eclipse.persistence.core
 +
| [http://download.eclipse.org/rt/eclipselink/maven.repo/org/eclipse/persistence/org.eclipse.persistence.jpa/2.4.0/org.eclipse.persistence.jpa-2.4.0.pom POM]
 
|-
 
|-
| org.eclipse.persistence.jpa.modelgen.processor || EclipseLink JPA Modelgen Processor (non-OSGi) (Meta-data only)
+
| org.eclipse.persistence.moxy
 +
| EclipseLink MOXy (OSGi bundle): Use this artifact if you only want EclipseLink's Object-XML binding and JAXB implementation. This also includes JSON binding support.
 +
| org.eclipse.persistence.core
 +
| [http://download.eclipse.org/rt/eclipselink/maven.repo/org/eclipse/persistence/org.eclipse.persistence.moxy/2.4.0/org.eclipse.persistence.moxy-2.4.0.pom POM]
 
|-
 
|-
| org.eclipse.persistence.tools.oracleddl || Oracle DB model - OSGi bundle 
+
| org.eclipse.persistence.nosql
 +
| EclipseLink NoSQL (OSGi fragment): Provides NoSQL support extending org.eclipse.persistence.core.
 +
| javax.persistence<br/>org.eclipse.persistence.asm<br/>org.eclipse.persistence.antlr<br/>org.eclipse.persistence.jpa.jpql<br/>org.eclipse.persistence.core<br/>
 +
| [http://download.eclipse.org/rt/eclipselink/maven.repo/org/eclipse/persistence/org.eclipse.persistence.nosql/2.4.0/org.eclipse.persistence.nosql-2.4.0.pom POM]
 
|-
 
|-
| org.eclipse.persistence.weaving || EclipseLink JPA - "Weaving for Equinox" OSGi Fragment
+
| org.eclipse.persistence.oracle
 +
| EclipseLink JPA for Oracle (OSGi fragment): Extended Oracle database capabilities extending the core bundle with specific Oracle JDBC dependencies.
 +
| javax.persistence<br/>org.eclipse.persistence.asm<br/>org.eclipse.persistence.core
 +
| [http://download.eclipse.org/rt/eclipselink/maven.repo/org/eclipse/persistence/org.eclipse.persistence.oracle/2.4.0/org.eclipse.persistence.oracle-2.4.0.pom POM]
 
|-
 
|-
|
+
| org.eclipse.persistence.oracle.nosql
 +
| EclipseLink NoSQL for Oracle (OSGI fragment): Oracle specific NoSQL support extending core bundle.
 +
| javax.persistence<br/>org.eclipse.persistence.asm<br/>org.eclipse.persistence.antlr<br/>org.eclipse.persistence.jpa.jpql<br/>org.eclipse.persistence.core<br/>org.eclipse.persistence.nosql
 +
| [http://download.eclipse.org/rt/eclipselink/maven.repo/org/eclipse/persistence/org.eclipse.persistence.oracle.nosql/2.4.0/org.eclipse.persistence.oracle.nosql-2.4.0.pom POM]
 
|-
 
|-
| eclipselink || The non-OSGI EclipseLink jar (includes the functionality below)
+
| org.eclipse.persistence.dbws
 +
| EclipseLink DBWS OSGI bundle
 
|-
 
|-
| org.eclipse.persistence.antlr || EclipseLink ANTLR OSGI bundle
+
| org.eclipse.persistence.jpa.modelgen
|-  
+
| EclipseLink Modelgen pre-processor (non-OSGI)
| org.eclipse.persistence.asm || EclipseLink ASM OSGI bundle
+
 
|-
 
|-
| org.eclipse.persistence.core || EclipseLink Core OSGI bundle
+
| org.eclipse.persistence.osgi
 +
| <br>
 
|-
 
|-
| org.eclipse.persistence.dbws || EclipseLink DBWS OSGI bundle
+
| org.eclipse.persistence.sdo
|-
+
| EclipseLink SDO OSGI bundle
| org.eclipse.persistence.jpa || EclipseLink JPA OSGI bundle
+
 
|-
 
|-
| org.eclipse.persistence.jpa.modelgen || EclipseLink Modelgen pre-processor (non-OSGI)
+
| org.eclipse.persistence.equinox
 +
| EclipseLink JPA Equinox OSGi Fragment
 
|-
 
|-
| org.eclipse.persistence.moxy || EclipseLink MOXY OSGI bundle
+
| org.eclipse.persistence.jpa.modelgen.processor
 +
| EclipseLink JPA Modelgen Processor (non-OSGi) (Meta-data only)
 
|-
 
|-
| org.eclipse.persistence.oracle || OSGI fragment bundle with Oracle-DB specific EclipseLink extensions
+
| org.eclipse.persistence.tools.oracleddl
 +
| Oracle DB model - OSGi bundle
 
|-
 
|-
| org.eclipse.persistence.osgi ||
+
| org.eclipse.persistence.weaving
|-
+
| EclipseLink JPA - "Weaving for Equinox" OSGi Fragment
| org.eclipse.persistence.sdo || EclipseLink SDO OSGI bundle
+
 
|}
 
|}
  
=== Runtime Dependencies (from Orbit) ===
+
== Versions  ==
 
+
{|{{BMTableStyle}}
+
|-{{BMTHStyle}}
+
! Group Id
+
! Artifact Id
+
! Description
+
|-
+
| commonj.sdo || commonj.sdo || OSGI-enabled SDO API bundle
+
|-
+
| javax.activation || javax.activation || OSGI-enabled javax.activation API bundle
+
|-
+
| javax.mail || javax.mail || OSGI-enabled javax.mail bundle
+
|-
+
| javax.servlet || javax.servlet || OSGI-enabled javax.servlet bundle
+
|-
+
| javax.xml.bind || javax.xml.bind || OSGI-enabled javax.xml.bind bundle
+
|-
+
| javax.xml.stream || javax.xml.stream || OSGI-enabled javax.xml.stream bundle
+
|}
+
 
+
 
+
 
+
== What bundles should I get ==
+
 
+
The following lists what you should get based on your needs
+
 
+
==== Full functionality - non OSGI ====
+
 
+
This is the recommended way of getting EclipseLink unless you are using OSGi, or you want to explicitly exclude certain parts of EclipseLink
+
 
+
* eclipselink
+
* javax.persistence (optional - only needed if you are using JPA outside of a Java EE container)
+
 
+
==== JPA Only ====
+
 
+
* JPA
+
* Core (starting in 2.0.0 should be retrieved by maven dependency mechanism)
+
* Antlr (starting in 2.0.0 should be retrieved by maven dependency mechanism)
+
* Asm (starting in 2.0.0 should be retrieved by maven dependency mechanism)
+
* javax.persistence
+
* Oracle (optional - only needed to access Oracle DB specific functionality)
+
 
+
==== MOXy Only ====
+
 
+
* MOXy
+
* Core (starting in 2.0.0 should be retrieved by maven dependency mechanism)
+
* Antlr (starting in 2.0.0 should be retrieved by maven dependency mechanism)
+
* Asm (starting in 2.0.0 should be retrieved by maven dependency mechanism)
+
 
+
==== SDO Only ====
+
  
* SDO
+
For the available EclipseLink release versions please refer to the [http://www.eclipse.org/eclipselink/releases/ releases page]. It is the 3 digit number that is used. For access to nightly or milestone builds please see [[EclipseLink/Maven/NightlyMilestones]]
* MOXy
+
* Core (starting in 2.0.0 should be retrieved by maven dependency mechanism)
+
* Antlr (starting in 2.0.0 should be retrieved by maven dependency mechanism)
+
* Asm (starting in 2.0.0 should be retrieved by maven dependency mechanism)
+
  
==== Core Only ====
+
== Sample pom.xml  ==
  
* Core (starting in 2.0.0 should be retrieved by maven dependency mechanism)
+
The following pom.xml is from an EclipseLink example that uses JPA to access a MySQL database and leverages JUnit for testing.
* Antlr (starting in 2.0.0 should be retrieved by maven dependency mechanism)
+
* Asm (starting in 2.0.0 should be retrieved by maven dependency mechanism)
+
* Oracle (optional - only needed to access Oracle DB specific functionality)
+
  
== Versioning ==
+
<source lang="xml">
 +
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 +
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 +
<modelVersion>4.0.0</modelVersion>
  
===Available Released Versions===
+
<groupId>org.eclipse.persistence.example</groupId>
 +
<artifactId>Employee</artifactId>
 +
<version>0.0.1-SNAPSHOT</version>
 +
<packaging>jar</packaging>
  
* 2.2.0
+
<name>Employee Example</name>
* 2.1.2
+
<url>http://wiki.eclipse.org/EclipseLink/Examples/JPA/Employee</url>
* 2.1.1
+
<description>Simple JPA example using annotations.</description>
* 2.1.0
+
* 2.0.2
+
* 2.0.1
+
* 2.0.0
+
** JPA 2.0 Implementation release
+
* 1.2.0
+
* 1.1.4
+
** final 1.1.x patchset
+
* 1.1.3
+
* 1.1.2
+
** Eclipse Galileo Release
+
* 1.1.1
+
* 1.1.0
+
* 1.0.2
+
* 1.0.1
+
* 1.0
+
  
NOTE: javax.persistence (JPA 2.0) has been released as version 2.0.0, 2.0.1, 2.0.2, and 2.0.3
+
<properties>
 +
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 +
<eclipselink.version>2.4.0</eclipselink.version>
 +
</properties>
  
===Releases Under development===
+
<repositories>
 +
<repository>
 +
<id>EclipseLink</id>
 +
<url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
 +
</repository>
 +
</repositories>
  
* 2.3.0
+
<dependencies>
* 2.2.1
+
* 2.1.3
+
<!-- eclipselink.jar with dependencies except commonj.sdo -->
* 2.0.3
+
<dependency>
* 1.2.1
+
<groupId>org.eclipse.persistence</groupId>
 +
<artifactId>eclipselink</artifactId>
 +
<version>${eclipselink.version}</version>
 +
<exclusions>
 +
<exclusion>
 +
<artifactId>commonj.sdo</artifactId>
 +
<groupId>commonj.sdo</groupId>
 +
</exclusion>
 +
</exclusions>
 +
</dependency>
  
''Under development releases have the following additional naming conventions''
+
<dependency>
 +
<groupId>mysql</groupId>
 +
<artifactId>mysql-connector-java</artifactId>
 +
<version>5.1.21</version>
 +
</dependency>
  
* <releaseNumber>-SNAPSHOT (The most recent nightly build e.g. 2.1.0-SNAPSHOT)
+
<dependency>
* <releaseNumber>-Mx (For milestones, replace x with the milestone number e.g. 2.0.0-M1)
+
<groupId>junit</groupId>
* <releaseNumber>-RCx (For release candidates, replace x with the release candidate number e.g. 2.0.0-RC1)
+
<artifactId>junit</artifactId>
 +
<version>4.8.2</version>
 +
</dependency>
 +
</dependencies>
  
== Sample pom.xml entries ==
+
<build>
 +
...
 +
</build>
  
<pre>
+
</project>
 +
</source>
  
<dependencies>
+
== Issues With Nexus ==
  <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>
+
    <!-- note that ampersands in this URL are escaped because this is in an xml file -
+
            un-escape them to use in browser
+
    -->
+
    <url>http://www.eclipse.org/downloads/download.php?r=1&amp;amp;nf=1&amp;amp;file=/rt/eclipselink/maven.repo</url>
+
    <!-- use this for javax.persistence
+
    <snapshots>
+
        <enabled>true</enabled>
+
    </snapshots> -->
+
  </repository>   
+
      ...
+
</repositories>
+
  
</pre>
+
The current repository have some issues when used with Nexus.  Here are some [http://wiki.eclipse.org/EclipseLink/Maven/Nexus  workarounds].
  
 
[[Category:EclipseLink|Maven]]
 
[[Category:EclipseLink|Maven]]

Revision as of 11:07, 17 October 2012

The EclipseLink project currently produces a maven repository for its releases

If you have any questions about using it, or experience problems, please let us know on our users mailing list or forum.

Configuring your pom.xml

To help users diagnose Maven issues, we have created a basic POM that simply establishes EclipseLink dependencies (currenly using the 2.4.0 release). Executing it will verify your connection to the repository. Alternate Repository URLs are discussed. The POM can be found [here].

<repository>

Within your pom.xml you will need to specify the EclipseLink repository using:

<repository>
   <id>EclipseLink</id>
   <url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
</repository>

<dependencies>

The artifacts can then be added to you pom as follows. The complete list of available artifacts and their usage is below.

<dependency>\
   <groupId>org.eclipse.persistence</groupId>
   <artifactId>{artifact}</artifactId>
   <version>{version}</version>
   <scope>compile</scope>
</dependency>

The following are the primary artifacts. All listed dependencies are also included in this repository.

Artifact Id Description Dependencies 2.4.0 POM
eclipselink The full eclipselink.jar (non-OSGi) including the full capabilities of all of the following artifact bundles and fragments. javax.persistence
commonj.sdo
POM
org.eclipse.persistence.jpa EclipseLink JPA (OSGi bundle): Use this artifact if you only want EclipseLink's JPA capabilities for relational databases. If accessing an Oracle database then you will also want the org.eclipse.persistence.oracle artifact. javax.persistence
org.eclipse.persistence.asm
org.eclipse.persistence.antlr
org.eclipse.persistence.jpa.jpql
org.eclipse.persistence.core
POM
org.eclipse.persistence.moxy EclipseLink MOXy (OSGi bundle): Use this artifact if you only want EclipseLink's Object-XML binding and JAXB implementation. This also includes JSON binding support. org.eclipse.persistence.core POM
org.eclipse.persistence.nosql EclipseLink NoSQL (OSGi fragment): Provides NoSQL support extending org.eclipse.persistence.core. javax.persistence
org.eclipse.persistence.asm
org.eclipse.persistence.antlr
org.eclipse.persistence.jpa.jpql
org.eclipse.persistence.core
POM
org.eclipse.persistence.oracle EclipseLink JPA for Oracle (OSGi fragment): Extended Oracle database capabilities extending the core bundle with specific Oracle JDBC dependencies. javax.persistence
org.eclipse.persistence.asm
org.eclipse.persistence.core
POM
org.eclipse.persistence.oracle.nosql EclipseLink NoSQL for Oracle (OSGI fragment): Oracle specific NoSQL support extending core bundle. javax.persistence
org.eclipse.persistence.asm
org.eclipse.persistence.antlr
org.eclipse.persistence.jpa.jpql
org.eclipse.persistence.core
org.eclipse.persistence.nosql
POM
org.eclipse.persistence.dbws EclipseLink DBWS OSGI bundle
org.eclipse.persistence.jpa.modelgen EclipseLink Modelgen pre-processor (non-OSGI)
org.eclipse.persistence.osgi
org.eclipse.persistence.sdo EclipseLink SDO OSGI bundle
org.eclipse.persistence.equinox EclipseLink JPA Equinox OSGi Fragment
org.eclipse.persistence.jpa.modelgen.processor EclipseLink JPA Modelgen Processor (non-OSGi) (Meta-data only)
org.eclipse.persistence.tools.oracleddl Oracle DB model - OSGi bundle
org.eclipse.persistence.weaving EclipseLink JPA - "Weaving for Equinox" OSGi Fragment

Versions

For the available EclipseLink release versions please refer to the releases page. It is the 3 digit number that is used. For access to nightly or milestone builds please see EclipseLink/Maven/NightlyMilestones

Sample pom.xml

The following pom.xml is from an EclipseLink example that uses JPA to access a MySQL database and leverages JUnit for testing.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
 
	<groupId>org.eclipse.persistence.example</groupId>
	<artifactId>Employee</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>
 
	<name>Employee Example</name>
	<url>http://wiki.eclipse.org/EclipseLink/Examples/JPA/Employee</url>
	<description>Simple JPA example using annotations.</description>
 
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<eclipselink.version>2.4.0</eclipselink.version>
	</properties>
 
	<repositories>
		<repository>
			<id>EclipseLink</id>
			<url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
		</repository>
	</repositories>
 
	<dependencies>
 
		<!-- eclipselink.jar with dependencies except commonj.sdo -->
		<dependency>
			<groupId>org.eclipse.persistence</groupId>
			<artifactId>eclipselink</artifactId>
			<version>${eclipselink.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>commonj.sdo</artifactId>
					<groupId>commonj.sdo</groupId>
				</exclusion>
			</exclusions>
		</dependency>
 
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.21</version>
		</dependency>
 
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.8.2</version>
		</dependency>
	</dependencies>
 
	<build>
		...
	</build>
 
</project>

Issues With Nexus

The current repository have some issues when used with Nexus. Here are some workarounds.