Jump to: navigation, search

Difference between revisions of "EclipseLink/Maven"

(Issues With Nexus)
m
(14 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
__TOC__  
 
__TOC__  
 
</div> </div>
 
</div> </div>
The EclipseLink project currently produces a maven repository for its releases
+
The EclipseLink project currently produces a maven repository for its nightly, milestone, and release builds.
  
<div align="center">'''http://download.eclipse.org/rt/eclipselink/maven.repo'''</div>
+
<div align="center">'''https://oss.sonatype.org/content/groups/staging'''</div>
 +
 
 +
<div align="center">[https://oss.sonatype.org/index.html#nexus-search;gav~org.eclipse.persistence Browse Repo]</div>
  
 
If you have any questions about using it, or experience problems, please let us know on our users mailing list or forum.  
 
If you have any questions about using it, or experience problems, please let us know on our users mailing list or forum.  
Line 12: Line 14:
 
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]].  
 
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]].  
  
=== <repository> ===
+
=== Repositories ===
 +
 
 +
Within your pom.xml you will need to specify the EclipseLink repository (within <repositories>).
 +
 
 +
==== oss.sonatype.org: 2.4.2 and Later ====
 +
 
 +
The EclipseLink project has switched to publishing its builds through oss.sonatype org during the 2.4.2/2.5.0 development. The staging repo will provide access to SNAPSHOT and named milestone and release candidate builds. To access these use:
 +
 
 +
<source lang="xml">
 +
<repository>
 +
<id>oss.sonatype.org</id>
 +
<name>OSS Sonatype Staging</name>
 +
<url>https://oss.sonatype.org/content/groups/staging</url>
 +
</repository>
 +
</source>
 +
 
 +
When the 2.4.2 and above releases are finalized they will be published to [http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.eclipse.persistence%22 Maven Central] where no additional  repository configuration will be required.
 +
 
 +
==== Custom Repo: 2.4 and Earlier ====
 +
 
 +
For builds prior to EclipseLink 2.5 please use:
  
Within your pom.xml you will need to specify the EclipseLink repository using:
 
 
<source lang="xml">
 
<source lang="xml">
 
<repository>
 
<repository>
Line 27: Line 48:
  
 
<source lang="xml">
 
<source lang="xml">
<dependency>\
+
<dependency>
 
   <groupId>org.eclipse.persistence</groupId>
 
   <groupId>org.eclipse.persistence</groupId>
 
   <artifactId>{artifact}</artifactId>
 
   <artifactId>{artifact}</artifactId>
Line 103: Line 124:
 
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]]
 
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]]
  
== Sample pom.xml  ==
+
== Sample pom.xml  (Staging) ==
  
The following pom.xml is from an EclipseLink example that uses JPA to access a MySQL database and leverages JUnit for testing.
+
The following pom.xml illustrates access the EclipseLink 2.5.0-RC1 from our staging repository.
  
 
<source lang="xml">
 
<source lang="xml">
 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 
<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">
+
  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>
 
<modelVersion>4.0.0</modelVersion>
 
+
<groupId>eclipselink.example.jpa</groupId>
<groupId>org.eclipse.persistence.example</groupId>
+
<artifactId>simple</artifactId>
<artifactId>Employee</artifactId>
+
<version>2.5.0-SNAPSHOT</version>
<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>
 
<repositories>
 
<repository>
 
<repository>
<id>EclipseLink</id>
+
<id>oss.sonatype.org</id>
<url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
+
<name>OSS Sonatype Staging</name>
 +
<url>https://oss.sonatype.org/content/groups/staging</url>
 
</repository>
 
</repository>
 
</repositories>
 
</repositories>
 
+
 
<dependencies>
 
<dependencies>
 
<!-- eclipselink.jar with dependencies except commonj.sdo -->
 
 
<dependency>
 
<dependency>
 
<groupId>org.eclipse.persistence</groupId>
 
<groupId>org.eclipse.persistence</groupId>
 
<artifactId>eclipselink</artifactId>
 
<artifactId>eclipselink</artifactId>
<version>${eclipselink.version}</version>
+
<version>2.5.0-RC1</version>
 
<exclusions>
 
<exclusions>
 
<exclusion>
 
<exclusion>
 +
<groupId>org.eclipse.persistence</groupId>
 
<artifactId>commonj.sdo</artifactId>
 
<artifactId>commonj.sdo</artifactId>
<groupId>commonj.sdo</groupId>
 
 
</exclusion>
 
</exclusion>
 
</exclusions>
 
</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>
 
</dependency>
 
</dependencies>
 
</dependencies>
 
<build>
 
...
 
</build>
 
 
 
</project>
 
</project>
 
</source>
 
</source>
Line 170: Line 162:
 
== Issues With Nexus ==
 
== Issues With Nexus ==
  
The current repository have some issues when used with Nexus.  Here are some [[http://wiki.eclipse.org/EclipseLink/Maven/Nexus | workarounds]].
+
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 15:48, 7 May 2013

The EclipseLink project currently produces a maven repository for its nightly, milestone, and release builds.

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

Repositories

Within your pom.xml you will need to specify the EclipseLink repository (within <repositories>).

oss.sonatype.org: 2.4.2 and Later

The EclipseLink project has switched to publishing its builds through oss.sonatype org during the 2.4.2/2.5.0 development. The staging repo will provide access to SNAPSHOT and named milestone and release candidate builds. To access these use:

<repository>
	<id>oss.sonatype.org</id>
	<name>OSS Sonatype Staging</name>
	<url>https://oss.sonatype.org/content/groups/staging</url>
</repository>

When the 2.4.2 and above releases are finalized they will be published to Maven Central where no additional repository configuration will be required.

Custom Repo: 2.4 and Earlier

For builds prior to EclipseLink 2.5 please use:

<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 (Staging)

The following pom.xml illustrates access the EclipseLink 2.5.0-RC1 from our staging repository.

<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>eclipselink.example.jpa</groupId>
	<artifactId>simple</artifactId>
	<version>2.5.0-SNAPSHOT</version>
 
	<repositories>
		<repository>
			<id>oss.sonatype.org</id>
			<name>OSS Sonatype Staging</name>
			<url>https://oss.sonatype.org/content/groups/staging</url>
		</repository>
	</repositories>
 
	<dependencies>
		<dependency>
			<groupId>org.eclipse.persistence</groupId>
			<artifactId>eclipselink</artifactId>
			<version>2.5.0-RC1</version>
			<exclusions>
				<exclusion>
					<groupId>org.eclipse.persistence</groupId>
					<artifactId>commonj.sdo</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
	</dependencies>
</project>

Issues With Nexus

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