Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/Building"

m (Migrating Eclipse Projects to PDE as of 20080430)
m (From Eclipse)
(78 intermediate revisions by 8 users not shown)
Line 1: Line 1:
__NOTOC__
+
== Git Structure ==
  
 +
EclipseLink code has migrated from SVN to Git. The SVN repository has been split into several repositories. The repository list, descriptions, and urls can be found at: http://git.eclipse.org under the EclipseLink project list.
  
 +
=== Runtime===
  
== Licensing Issues ==
+
The below is a description of the content of the directories.  Note: All projects are Eclipse PDE projects and therefore classpath dependencies are defined in the manifest rather than the project metadata.
  
We are still sorting through some licensing issues for some of the libraries we depend on and upgrading code to use libraries that are EPL compliant.  In the mean time, you may be able to use the following information to build the various projects.
+
==== Plugins ====
  
== SVN Structure ==
+
The plugins directory contains all the common dependencies needed by all the projects.  You can make use of them by either importing the Eclipse projects for all the depenencies or by making the bundle jars (all the jars) in this directory available to Eclipse's target platform.  You can do that by adding a directory that contains those jars to your Target Platform under "Preferences -> Plug-in Development -> Target Platform", or by copying them to your Eclipse installation's plugin's directory.
  
At the moment, all code can be found in the org.eclipse.persistence/trunk directory on the technology SVN server. The following directories are designed to be compilable sub-components of EclipseLink.  They each contain an ''src'' directory and potentially a ''resource'' directory that the files necessary for building and running.
+
The following dependencies can also be obtained from [http://wiki.eclipse.org/index.php/Orbit_Faq Orbit].
  
'''Runtime'''
+
* commonj.sdo 2.1.1
* foundation/org.eclipse.persistence.core - the core of EclipseLink
+
* javax.activation 1.1.0
* foundation/eclipselink.extension.oracle - extensions that require Oracle-specific libraries for compilation. You will not be able to build these extensions until some of the licensing issues have been sorted out. The compiled classes will be checked in soon so that people without those dependancies can use the compiled classes.
+
* javax.mail 1.4.0
* jpa/org.eclipse.persistence.jpa - EclipseLink's JPA support
+
* javax.persistence 1.0.0
* foundation/eclipselink.core.lib - this will contain all the libraries the core depends on to build.
+
* javax.servlet 2.4.0
 +
* javax.wsdl 1.6.2
 +
* javax.xml.bind 2.0.0
 +
* javax.xml.rpc 1.1.0
 +
* javax.xml.stream 1.0.1
 +
* javax.xml.ws 2.1.0
 +
* org.apache.ant 1.7.0
  
'''Testing'''
+
[http://wiki.eclipse.org/index.php/Orbit_Faq#How_do_I_work_with_a_bundle_in_Orbit.3F Instructions about getting bundles from Orbit]
  
'''''Note''': Before testing in Eclipse using the Testing Browser - you will need to a full root build of EclipseLink in 'trunk>ant' so that the test jars eclipse*model.jar get created and placed on the root of jpa/eclipselink.jpa.test.  Please refresh your eclipselink.jpa.test project to pick these up before running the Testing Browser eclipse launch target.''
+
==== Foundation ====
* foundation/eclipselink.core.test - the core testing for EclipseLink
+
* foundation/eclipselink.extension.oracle.test - the testing for EclipseLink's Oracle-specific functionality.  Like the ''extension.oracle'' directory, this will only build after some licensing issues have been sorted out.
+
* jpa/eclipselink.jpa.test - the JPA tests for EclipseLink
+
  
== Projects and Dependencies ==
+
* org.eclipse.persistence.core - All other EclipseLink components depend on this bundle.  You will need to import this project to work on other EclipseLink components. All other components can be imported separately.
 +
* org.eclipse.persistence.oracle - extensions that require Oracle-specific libraries for compilation. If you do not have the required oracle libraries, you can get the compiled classes since they are checked in.  This bundle is only used for advanced Oracle-specific functionality and not required unless you are using that functionality.
 +
** The oracle bundle requires that you configure the oracle target within your Eclipse.  To do that, you will need to do the following:
 +
*** Find the target.oracle directory in foundation/targets
 +
*** Obtain the Oracle dependency jars and put them into oracle.libs folder.  There is a list of them in the manifest found in oracle.libs.  Note: These are not currently available in open-source format and you will have to obtain them from Oracle
 +
*** Import the target.oracle directory and its contents into Eclipse as a Plug-in fragment
  
Eclipse Projects are available for eclipselink.core, eclipselink.core.lib, eclipselink.core.test jpa, jpa.test, sdo, sdo.test, moxy and moxy.test.  These projects should allow you to use most of the core EclipseLink functionality.
+
==== JPA ====
  
Until our dependencies have been checked in, you should be able to build use the following dependencies to build.
+
* org.eclipse.persistence.jpa - EclipseLink's JPA support
 +
* plugins - The additional dependencies for JPA support
  
# org.eclipse.persistence.core depends on the following:
+
==== MOXY ====
## eclipselink.core.lib - The Eclipse Project defined in this folder
+
# org.eclipse.persistence.jpa depends on the following:
+
## org.eclipse.persistence.core - The Eclipse project defined in this folder
+
# eclipselink.core.test should have all its dependencies already set but provides an ant build that sets up some xml files to run
+
# eclipselink.jpa.test should have all its dependencies already set but provides an ant build to build persistence units for testing
+
# eclipselink.extension.oracle depends on a selection of jars from Oracle products.  In order to build this project you will need to obtain all these jars.  As a result the class files from this project are checked in so they can be used by people that do not have those jars
+
## Jars:
+
### aqapi.jar - Oracle Advanced Queue
+
### sdoapi.jar - Oracle Spatial API
+
### An oracle JDBC driver
+
### xdb.jar - XDB
+
### xml.jar - Oracle XML support
+
### xmlparserv2.jar - Oracle XML parser
+
## Projects
+
### eclipselink.core depends on the same jars as foundation/extension.oracle and as a result, it has also had class files checked in
+
# eclipselink.extension.oracle.test depends on
+
## eclipselink.extension.oracle
+
## eclipselink.core.test
+
## org.eclipse.persistence.jpa
+
# org.eclipse.persistence.moxy depends on the following:
+
## org.eclipse.persistence.core
+
# eclipselink.moxy.test depends on the following:
+
## org.eclipse.persistence.moxy
+
## org.eclipse.persistence.core
+
## Eclipse Library JUnit 3 - this is already configured, but there have been issues with Eclipse version 3.2 where the library needs to be reselected in order for JUnit to be picked up properly.
+
# eclipselink.sdo depends on the following:
+
## org.eclipse.persistence.core
+
## eclipselink.core.lib
+
# eclipselink.sdo.test depends on the following:
+
## org.eclipse.persistence.sdo
+
## org.eclipse.persistence.core
+
## TOOLS_LIB variable has been mapped to your JDK tools.jar for a runtime dependency
+
## Eclipse Library JUnit 3 - this is already configured, but there have been issues with Eclipse version 3.2 where the library needs to be reselected in order for JUnit to be picked up properly.
+
  
== Migrating Eclipse Projects to PDE as of 20080430 ==
+
* org.eclipse.persistence.moxy - EclipseLink's Object-XML support
There is a new PDE structure being finalized that will require a rebuild of all existing EclipseLink projects in Eclipse.
+
* plugins - The additional dependencies for Object-XML support
See [EclipseLink/Development/EclipseLinkPDEConversionPlan http://wiki.eclipse.org/EclipseLink/Development/EclipseLinkPDEConversionPlan]
+
  
These notes will be incorporated into the main doc and formalized when this process is complete.
+
==== SDO ====
  
*Migrating Eclipse Projects to PDE #2 as of 20080508 - currently editing
+
* org.eclipse.persistence.sdo - EclipseLink's SDO support
<font color="green">This section is for developers that did the initial PDE refresh after 20080430.</font>
+
* plugins - The additional dependencies for SDO support
*Remove existing lib projects and reimport as plugin projects (delete project but not workspace contents)
+
**All javax.*, org.apache.*, org.*antlr, org.*.asm
+
*Perform actions below
+
  
<font color="red">Note: If you are getting compilation errors that are due to a missing plugin like javax.resource or javax.jms - and you have these projects in your workspace.  The fix seems to be to delete these projects (not the filesystem) and reimport the project with the problem as well as the plugin that it is complaining it cannot find - together in a single import (from the <root>).</font>
+
==== DBWS ====
  
#Prerequisites
+
* org.eclipse.persistence.dbws - EclipseLink's Database Webservice support
##Eclipse 3.3+ EE version required - you will need the EE version of eclipse
+
* plugins - The additional dependencies for DBWS support
###Internal: eclipse-jee-europa-winter-win32, eclipse-jee-europa-fall2-win32 or eclipse-jee-ganymede-M6-win32
+
##Remove any existing eclipselink.* projects (delete project but not workspace contents)
+
##Note: eclipselink.*.test projects are not migrated yet, these can be retained
+
##Keep existing classpath variables
+
#Update SVN at the <trunk> root
+
#Importing Projects
+
##Import | General | Existing projects into Workspace
+
### root directory = <trunk>/plugins
+
### Leave "Copy projects into workspace" unselected
+
### select all of javax.* and org.*
+
##Import jpa/plugins/javax.persistence
+
##Import foundation projects in the same way
+
##Import jpa projects in the same way
+
##Import moxy/plugins projects so jpa test project compiles
+
##Import sdo/plugins
+
##Refresh/Rebuild
+
### If automatic build is not checked - check it and clean all projects
+
##core dependency on jpa lib project
+
### see javax.persistence;bundle-version="1.99.0";visibility:=reexport in the core project
+
### If you get a compile error on javax.persistence it is because we are referencing the 1.99 version instead of 1.0 in the manifest of org.eclipse.persistence.core - make sure the jpa project javax.persistence.1.99 is loaded in your workspace.
+
#Building
+
##Run ant at the <trunk> root so that all the test project jars are updated and built
+
##BUILD SUCCESSFUL Total time: 8 minutes 4 seconds
+
#Running
+
##Test the build by running test.jpa
+
##<trunk>/ant test.jpa
+
##Note: if db.platform is not set in your <user-home>/test.properties then you may get a "ClassNotFoundException: ${db.platform}" - set this variable as follows (using your own platform)
+
###db.platform=org.eclipse.persistence.platform.database.oracle.Oracle11Platform
+
###Normally we do not set a dependecy on the platform though - this will be fixed shortly in our script.
+
###[junit] Tests run: 911, Failures: 0, Errors: 1, Time elapsed: 583.35 sec Total time: 10 minutes 4 Seconds
+
#See the following (I get 1 error locally that can be ignored)
+
##C:\view_w34\jpa\eclipselink.jpa.test\reports\junit-noframes.html
+
#Refresh eclipse workspace to optionally run the testing browser targets
+
#'''Pending:'''
+
#Launch Targets
+
  
== Port TODO List ==
+
== Build ==
  
List of task, items, issues, refactorig left to due from the initial port.
+
Importing the projects into Eclipse will build the class files for the PDE projects. Most functionality will be accessible after those builds. Ant files are also provided both for use in a non-Eclipse IDE, and for commandline use.  If you want to do a complete build of the EclipseLink artifacts, the steps are outlined In the "building with Ant" section below.
* Get all tests passing. - JPA JUnit tests and legacy LRG model currently pass
+
* Move left-over internal classes to internal packages.
+
* Internationalization.
+
* Server tests.
+
* Sun Corba and RMI-IIOP - are these elements still required in EclipseLink.  If so, make sure tests work. Else, remove.
+
* Make all server platforms work.  i.e. address the fact that they all need to be reflective to compile
+
  
== How To ==
+
==== Building with Ant ====
 +
Ant is used to drive all builds for the EclipseLink Project. Furthermore, it is assumed that EclipseLink will be built (ant tested) in environments other than the Eclipse IDE (PDE build). Therefore, the Ant buildfiles are designed to be used from many entry points with varying configurations. However, starting with 2.4, we have moved to a manifest-first approach to build our OSGi bundles. Therefore, rather than using BND to generate the OSGi manifest post build we are using Tycho (a maven plugin) to generate our OSGi bundles.
  
* [[EclipseLink/Development/Testing/Prereq| General prerequisites for building & running EclipseLink tests]]
+
Below are the steps to setup for and then run a basic build of EclipseLink using the Ant buildfiles from the trunk.
* [[EclipseLink/Build/Antlr| Make changes to ANTLR generated JPA code]]
+
* [[EclipseLink/Test/LRG| Run the legacy LRG]]
+
* [[EclipseLink/Test/JPA| Run the JPA Junit tests]]
+
* [[EclipseLink/Development/TestStatus/MOXy-Instructions| Run the MOXy Junit tests]]
+
* [[EclipseLink/Development/TestStatus/SDO-Instructions| Run the SDO Junit tests]]
+
* [[EclipseLink/Building/Automate| Automated/Scripted SVN checkout ]]
+
* [[EclipseLink/Building/Optimize| Optimize SVN ]]
+
  
 +
===== Environment Setup =====
 +
Most of the required dependencies are already existent in one of the previously discussed plugin folders. However, there are some third-party files that are not supplied. Specifically:
 +
* Ant 1.9.x for 2.6.0, Ant 1.7 for earlier versions.
 +
** Our build scripts don't work properly under 1.8.
 +
** If not already installed, you will need to download and install it.
 +
* Maven 3 for EclipseLink 2.4+ (Tycho requires Maven 3 functionality).
 +
** If not already installed, you will need to download and install it.
 +
* Make sure you have an "ANT_HOME", "M2_HOME" and "JAVA_HOME" environment variables pointing to appropriate folders.
 +
* Junit 4.11 (or higher)
 +
* Any library licensed under an agreement that is not EPL or Eclipse approved. This includes Oracle libraries and 3rd party libraries needed to compile specific extensions
 +
* [http://www.aqute.biz/Code/Download#bnd BND] tool '''(2.3.x and earlier only)'''- we use bnd to generate our OSGi plugins in EclipseLink 2.3.x and earlier. Version .366 or later should work fine if placed in the extension.depend.dir or the buildsystem dir. In addition, if bnd is not available the build will attempt to generate meaningful OSGi manifests, but there are known shortcomings and issues with this approach.
 +
**Add the following entry to your '''user-dir/build.properties'''
 +
***<font color="red">''bndtool.jar=bnd-0.0.384.jar''</font> as of 20100513
 +
***<font color="red">''bndtool.lib=bnd-0.0.384.jar''</font> as of at least 2.4.2
 +
 +
 +
The build provides mechanisms to incorporate these dependencies outside of Git.
 +
build defaults: The build assumes certain defaults for dependencies. These can be overridden, but are provided to allow minimal configuration setup.
 +
* external dependency location: The build assumes that all dependant libraries external to Git are stored in one of two default locations.
 +
* extensions.depend.dir: This property defines where external dependencies can be found. (default: .\trunk\..\extension.lib.external)
 +
* oracle.extensions.depend.dir: This is a legacy property for compatability with Oracle testing scripts. It is used to define the location of  Oracle specific jars. (default: .\trunk\..\extension.oracle.lib.external)
 +
* library properties: Most dependant libraries are defined using a property definition that can be overridden
 +
 +
===== Overriding Defaults =====
 +
 +
Basic Setup
 +
* It may be necessary to create a user specific properties file to override the default values in <trunk>/build.properties. To do so, create a [[build.properties]] file in your user home directory (''usually '''C:\Documents and Settings\<username>''' on windows''). Variables commonly needing redefinition in it are:
 +
** For build:
 +
*** junit.lib=[http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22junit%22%20AND%20a%3A%22junit%22 $YOUR_JUNIT_DIR/junit.jar:$YOUR_JUNIT_DIR/hamcrest-core-1.3.jar]
 +
** For Test
 +
*** jdbc.driver.jar=<full path to your JDBC driver>
 +
*** db.driver=<classname of your JDBC driver>
 +
*** db.url=<JDBC url of your DB>
 +
*** db.user=<db username>
 +
*** db.pwd=<db password>
 +
*** (optional) db.platform=<EclipseLink Database Platform to use> - this is only necessary if EclipseLink does not properly dectect you DB with its database detection
 +
* Open a command prompt in your checked out trunk directory
 +
* Run "ant" '''(or "ant -f antbuild.xml" in 2.4 or later)''' for a full build of all core and test code
 +
* or
 +
* use the "build-eclipselink-jar" task for a full build of only core code
 +
 +
These commands will build the Runtime and/or the tests. Tests can also be run by adding a test execution target (like test-srg).
 +
 +
Note: Several DBWS component's build files are dependant upon JDK 1.6 (JDK 5 can be used but these components won't build)
 +
 +
== Updating dependencies ==
 +
In order to update EclipseLink's dependencies, take these steps:
 +
 +
# Prepare the dependency bundle. All product dependencies need to be OSGi bundles: so they need an OSGi manifest, and to be named appropriately: <bundleprefix>_<bundleversion>.<builddate>.jar.
 +
# Verify the bundle by building the EclipseLink with it:
 +
## Override the default remote compdeps setting to "local.compdeps=true" in your $home/build.properties file.
 +
## Add the new bundle to /plugins or /<module>/plugins (as appropriate).
 +
## Update antbuild.xml in buildsystem/compdeps.
 +
## Update features.xml in buildsystem/compdeps/org.eclipse.persistence.compdeps.
 +
## Update your module's MANIFEST.MF file to Import-Package your new dependency.
 +
# Once your plugin passes the build, you need to create a CQ (e.g. https://dev.eclipse.org/ipzilla/show_bug.cgi?id=8334). If you are on a tight schedule, I recommend doing this step ahead of the others, since it may take some time before the CQ is approved.
 +
# When the CQ is approved, create a bug on eclipse (e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=438761) and submit a patch containing the changes.
 +
# After the patch is pushed, contact the EL Releng team and ask them to update the p2 index.
 +
 +
For more detailed description see:
 +
* [[/UpdatingDependencies |Updating Dependencies page]]
 +
 +
== Testing ==
 +
 +
Tests can be run through Ant or in Eclipse
 +
 +
=== From Ant ===
 +
In the trunk directory, you can use the following targets to run tests:
 +
 +
* test-srg - Basic "smoke tests"
 +
* test-lrg - Full test model - must be run sucessfully on either MySQL or Oracle before checking in any changes to core classes
 +
* test-core - subset of tests just for the core
 +
* test-core-srg  - smoke tess for the core
 +
* test-jpa - runs JPA tests - required prior to check-in for any changes to JPA included in "test-lrg"
 +
** JPA tests require some artifacts from the build in order to be able to run.  There are two ways to get them.
 +
*** Run the full build as indicated above
 +
*** From the org.eclipse.persistence.jpa directory, run "ant"
 +
** This will create a directory required by the tests and the jars that contain the models.  You only need to rebuild if you are adding or subtracting from the models (Package org.eclipse.persistence.testing.models.jpa and its subpackages).
 +
* test-wdf  - runs the "WDF" JPA test suite (JPA tests contributed by SAP ('''W'''all'''d'''or'''f''', Germany)).
 +
* test-moxy - runs MOXY tests - required prior to check-in for any changes to MOXY included in "test-lrg"
 +
* test-jaxb - required prior to check-in for any changes to JAXB included in "test-moxy"
 +
* test-oxm  - required prior to check-in for any changes to OXM included in "test-moxy"
 +
* test-sdo  - required prior to check-in for any changes to SDO included in "test-lrg"
 +
 +
=== From Eclipse ===
 +
 +
The following directories contain projects with tests
 +
 +
* foundation/eclipselink.core.test - the core testing for EclipseLink
 +
** Testing Browser.launch - runs legacy test browser.  Requires definition of JDBC_LIB classpath variables.
 +
** SRGTestModel.launch - runs the SRG.  Requires definition of JDBC_LIB classpath variable
 +
** LRGTestModel.launch - runs the LRG. Requires definition of JDBC_LIB classpath variables.
 +
* foundation/eclipselink.extension.oracle.test - the testing for EclipseLink's Oracle-specific functionality.
 +
** Contains Testing Browser (Oracle).launch - Launches Legacy test browser in a manner that can run Legacy Oracle tests
 +
* jpa/eclipselink.jpa.test - the JPA tests for EclipseLink
 +
** See the description of the test-jpa target above for a prerequisite.
 +
** FullRegressionTestSuite.launch - runs JPA tests
 +
*** Needs DB properties to run.  either of the following can be done to give the DB properties:
 +
**** Add a JVM argument: -Dtest.properties=<full path to build.properties in your user home>
 +
**** update the test.properties file in jpa/eclipselink.jpa.test directory to point at correct DB
 +
** Testing Browser (JPA).launch - Launches Legacy test browser in a manner that can run JPA tests through that browser
 +
***Note: ''Recompilation of eclipselink.jpa.test test jars are required only if new classes were added/deleted since the last build.''
 +
* jpa/eclipselink.spring.test - Spring specific JPA testing
 +
* moxy/eclipselink.moxy.test - MOXY testing
 +
* sdo/eclipselink.sdo.test - SDO testing
 +
* dbws/eclipselink.dbws.test - DBWS Testing
 +
 +
====Minimum GIT projects for JPA or Core EclipseLink project Development and Testing====
 +
* The following import screen capture from Eclipse 4.4 details the minimum projects you will need in order to do JPA or Core development in Eclipse.
 +
[[file:Eclipselink-projects-corejpa.png]]
 +
* Before importing any test project into Eclipse, make sure you run full Ant build in order to let Eclipse resolve local test related dependencies
 +
* The following screens details the minimum test projects related to JPA and/or Core development in Eclipse.
 +
[[file:Eclipselink-projects-corejpa-tests.png]]
 +
*Note: Also add the org.eclipse.persistence.moxy project (a requirement of eclipselink.jpa.test)
 +
*Note: Also define "ECLIPSELINK_HOME" classpath variable (Java | Build Path | Classpath Variables) pointing to your local Git clone root folder
 +
 +
== Projects and Dependencies ==
  
 +
When using the Eclipse IDE - a Luna or later EE version is required. See the Eclipse download site for information http://www.eclipse.org/downloads
  
[[Category:EclipseLink|Building]]
+
All current dependencies can be found in the manifests for the PDE projects or in the bundles or in Problems view in Eclipse IDE.

Revision as of 18:35, 3 September 2014

Git Structure

EclipseLink code has migrated from SVN to Git. The SVN repository has been split into several repositories. The repository list, descriptions, and urls can be found at: http://git.eclipse.org under the EclipseLink project list.

Runtime

The below is a description of the content of the directories. Note: All projects are Eclipse PDE projects and therefore classpath dependencies are defined in the manifest rather than the project metadata.

Plugins

The plugins directory contains all the common dependencies needed by all the projects. You can make use of them by either importing the Eclipse projects for all the depenencies or by making the bundle jars (all the jars) in this directory available to Eclipse's target platform. You can do that by adding a directory that contains those jars to your Target Platform under "Preferences -> Plug-in Development -> Target Platform", or by copying them to your Eclipse installation's plugin's directory.

The following dependencies can also be obtained from Orbit.

  • commonj.sdo 2.1.1
  • javax.activation 1.1.0
  • javax.mail 1.4.0
  • javax.persistence 1.0.0
  • javax.servlet 2.4.0
  • javax.wsdl 1.6.2
  • javax.xml.bind 2.0.0
  • javax.xml.rpc 1.1.0
  • javax.xml.stream 1.0.1
  • javax.xml.ws 2.1.0
  • org.apache.ant 1.7.0

Instructions about getting bundles from Orbit

Foundation

  • org.eclipse.persistence.core - All other EclipseLink components depend on this bundle. You will need to import this project to work on other EclipseLink components. All other components can be imported separately.
  • org.eclipse.persistence.oracle - extensions that require Oracle-specific libraries for compilation. If you do not have the required oracle libraries, you can get the compiled classes since they are checked in. This bundle is only used for advanced Oracle-specific functionality and not required unless you are using that functionality.
    • The oracle bundle requires that you configure the oracle target within your Eclipse. To do that, you will need to do the following:
      • Find the target.oracle directory in foundation/targets
      • Obtain the Oracle dependency jars and put them into oracle.libs folder. There is a list of them in the manifest found in oracle.libs. Note: These are not currently available in open-source format and you will have to obtain them from Oracle
      • Import the target.oracle directory and its contents into Eclipse as a Plug-in fragment

JPA

  • org.eclipse.persistence.jpa - EclipseLink's JPA support
  • plugins - The additional dependencies for JPA support

MOXY

  • org.eclipse.persistence.moxy - EclipseLink's Object-XML support
  • plugins - The additional dependencies for Object-XML support

SDO

  • org.eclipse.persistence.sdo - EclipseLink's SDO support
  • plugins - The additional dependencies for SDO support

DBWS

  • org.eclipse.persistence.dbws - EclipseLink's Database Webservice support
  • plugins - The additional dependencies for DBWS support

Build

Importing the projects into Eclipse will build the class files for the PDE projects. Most functionality will be accessible after those builds. Ant files are also provided both for use in a non-Eclipse IDE, and for commandline use. If you want to do a complete build of the EclipseLink artifacts, the steps are outlined In the "building with Ant" section below.

Building with Ant

Ant is used to drive all builds for the EclipseLink Project. Furthermore, it is assumed that EclipseLink will be built (ant tested) in environments other than the Eclipse IDE (PDE build). Therefore, the Ant buildfiles are designed to be used from many entry points with varying configurations. However, starting with 2.4, we have moved to a manifest-first approach to build our OSGi bundles. Therefore, rather than using BND to generate the OSGi manifest post build we are using Tycho (a maven plugin) to generate our OSGi bundles.

Below are the steps to setup for and then run a basic build of EclipseLink using the Ant buildfiles from the trunk.

Environment Setup

Most of the required dependencies are already existent in one of the previously discussed plugin folders. However, there are some third-party files that are not supplied. Specifically:

  • Ant 1.9.x for 2.6.0, Ant 1.7 for earlier versions.
    • Our build scripts don't work properly under 1.8.
    • If not already installed, you will need to download and install it.
  • Maven 3 for EclipseLink 2.4+ (Tycho requires Maven 3 functionality).
    • If not already installed, you will need to download and install it.
  • Make sure you have an "ANT_HOME", "M2_HOME" and "JAVA_HOME" environment variables pointing to appropriate folders.
  • Junit 4.11 (or higher)
  • Any library licensed under an agreement that is not EPL or Eclipse approved. This includes Oracle libraries and 3rd party libraries needed to compile specific extensions
  • BND tool (2.3.x and earlier only)- we use bnd to generate our OSGi plugins in EclipseLink 2.3.x and earlier. Version .366 or later should work fine if placed in the extension.depend.dir or the buildsystem dir. In addition, if bnd is not available the build will attempt to generate meaningful OSGi manifests, but there are known shortcomings and issues with this approach.
    • Add the following entry to your user-dir/build.properties
      • bndtool.jar=bnd-0.0.384.jar as of 20100513
      • bndtool.lib=bnd-0.0.384.jar as of at least 2.4.2


The build provides mechanisms to incorporate these dependencies outside of Git. build defaults: The build assumes certain defaults for dependencies. These can be overridden, but are provided to allow minimal configuration setup.

  • external dependency location: The build assumes that all dependant libraries external to Git are stored in one of two default locations.
  • extensions.depend.dir: This property defines where external dependencies can be found. (default: .\trunk\..\extension.lib.external)
  • oracle.extensions.depend.dir: This is a legacy property for compatability with Oracle testing scripts. It is used to define the location of Oracle specific jars. (default: .\trunk\..\extension.oracle.lib.external)
  • library properties: Most dependant libraries are defined using a property definition that can be overridden
Overriding Defaults

Basic Setup

  • It may be necessary to create a user specific properties file to override the default values in <trunk>/build.properties. To do so, create a build.properties file in your user home directory (usually C:\Documents and Settings\<username> on windows). Variables commonly needing redefinition in it are:
    • For build:
    • For Test
      • jdbc.driver.jar=<full path to your JDBC driver>
      • db.driver=<classname of your JDBC driver>
      • db.url=<JDBC url of your DB>
      • db.user=<db username>
      • db.pwd=<db password>
      • (optional) db.platform=<EclipseLink Database Platform to use> - this is only necessary if EclipseLink does not properly dectect you DB with its database detection
  • Open a command prompt in your checked out trunk directory
  • Run "ant" (or "ant -f antbuild.xml" in 2.4 or later) for a full build of all core and test code
  • or
  • use the "build-eclipselink-jar" task for a full build of only core code

These commands will build the Runtime and/or the tests. Tests can also be run by adding a test execution target (like test-srg).

Note: Several DBWS component's build files are dependant upon JDK 1.6 (JDK 5 can be used but these components won't build)

Updating dependencies

In order to update EclipseLink's dependencies, take these steps:

  1. Prepare the dependency bundle. All product dependencies need to be OSGi bundles: so they need an OSGi manifest, and to be named appropriately: <bundleprefix>_<bundleversion>.<builddate>.jar.
  2. Verify the bundle by building the EclipseLink with it:
    1. Override the default remote compdeps setting to "local.compdeps=true" in your $home/build.properties file.
    2. Add the new bundle to /plugins or /<module>/plugins (as appropriate).
    3. Update antbuild.xml in buildsystem/compdeps.
    4. Update features.xml in buildsystem/compdeps/org.eclipse.persistence.compdeps.
    5. Update your module's MANIFEST.MF file to Import-Package your new dependency.
  3. Once your plugin passes the build, you need to create a CQ (e.g. https://dev.eclipse.org/ipzilla/show_bug.cgi?id=8334). If you are on a tight schedule, I recommend doing this step ahead of the others, since it may take some time before the CQ is approved.
  4. When the CQ is approved, create a bug on eclipse (e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=438761) and submit a patch containing the changes.
  5. After the patch is pushed, contact the EL Releng team and ask them to update the p2 index.

For more detailed description see:

Testing

Tests can be run through Ant or in Eclipse

From Ant

In the trunk directory, you can use the following targets to run tests:

  • test-srg - Basic "smoke tests"
  • test-lrg - Full test model - must be run sucessfully on either MySQL or Oracle before checking in any changes to core classes
  • test-core - subset of tests just for the core
  • test-core-srg - smoke tess for the core
  • test-jpa - runs JPA tests - required prior to check-in for any changes to JPA included in "test-lrg"
    • JPA tests require some artifacts from the build in order to be able to run. There are two ways to get them.
      • Run the full build as indicated above
      • From the org.eclipse.persistence.jpa directory, run "ant"
    • This will create a directory required by the tests and the jars that contain the models. You only need to rebuild if you are adding or subtracting from the models (Package org.eclipse.persistence.testing.models.jpa and its subpackages).
  • test-wdf - runs the "WDF" JPA test suite (JPA tests contributed by SAP (Walldorf, Germany)).
  • test-moxy - runs MOXY tests - required prior to check-in for any changes to MOXY included in "test-lrg"
  • test-jaxb - required prior to check-in for any changes to JAXB included in "test-moxy"
  • test-oxm - required prior to check-in for any changes to OXM included in "test-moxy"
  • test-sdo - required prior to check-in for any changes to SDO included in "test-lrg"

From Eclipse

The following directories contain projects with tests

  • foundation/eclipselink.core.test - the core testing for EclipseLink
    • Testing Browser.launch - runs legacy test browser. Requires definition of JDBC_LIB classpath variables.
    • SRGTestModel.launch - runs the SRG. Requires definition of JDBC_LIB classpath variable
    • LRGTestModel.launch - runs the LRG. Requires definition of JDBC_LIB classpath variables.
  • foundation/eclipselink.extension.oracle.test - the testing for EclipseLink's Oracle-specific functionality.
    • Contains Testing Browser (Oracle).launch - Launches Legacy test browser in a manner that can run Legacy Oracle tests
  • jpa/eclipselink.jpa.test - the JPA tests for EclipseLink
    • See the description of the test-jpa target above for a prerequisite.
    • FullRegressionTestSuite.launch - runs JPA tests
      • Needs DB properties to run. either of the following can be done to give the DB properties:
        • Add a JVM argument: -Dtest.properties=<full path to build.properties in your user home>
        • update the test.properties file in jpa/eclipselink.jpa.test directory to point at correct DB
    • Testing Browser (JPA).launch - Launches Legacy test browser in a manner that can run JPA tests through that browser
      • Note: Recompilation of eclipselink.jpa.test test jars are required only if new classes were added/deleted since the last build.
  • jpa/eclipselink.spring.test - Spring specific JPA testing
  • moxy/eclipselink.moxy.test - MOXY testing
  • sdo/eclipselink.sdo.test - SDO testing
  • dbws/eclipselink.dbws.test - DBWS Testing

Minimum GIT projects for JPA or Core EclipseLink project Development and Testing

  • The following import screen capture from Eclipse 4.4 details the minimum projects you will need in order to do JPA or Core development in Eclipse.

Eclipselink-projects-corejpa.png

  • Before importing any test project into Eclipse, make sure you run full Ant build in order to let Eclipse resolve local test related dependencies
  • The following screens details the minimum test projects related to JPA and/or Core development in Eclipse.

Eclipselink-projects-corejpa-tests.png

  • Note: Also add the org.eclipse.persistence.moxy project (a requirement of eclipselink.jpa.test)
  • Note: Also define "ECLIPSELINK_HOME" classpath variable (Java | Build Path | Classpath Variables) pointing to your local Git clone root folder

Projects and Dependencies

When using the Eclipse IDE - a Luna or later EE version is required. See the Eclipse download site for information http://www.eclipse.org/downloads

All current dependencies can be found in the manifests for the PDE projects or in the bundles or in Problems view in Eclipse IDE.

Back to the top