You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Establishing a Development Environment

There are two well established development environments that the SDO community use, Maven and Eclipse. To use the Eclipse IDE you must first establish a maven environment.

Setting up for Maven Development

  • Download and install Maven
  • Get your source tree set up locally
  • Ensure that maven (mvn) is on your execution path
  • Ensure that you have network connectivity (Maven has the capacity to retrieve dependencies from the internet while executing a build instruction)
  • In a shell or command prompt ensure that you are in the <sdo-source-root>spec/sdo-api directory
  • Issue the command "mvn", this will build the SDO API interface source code, run any tests, package the class files in a jar and install the jar in a repository on your computer where it will be available for other maven projects which depend on it
  • Change directory to <sdo-source-root>/sdo
  • execute the "mvn" command, this will build and test the SDO implementation, Tools and Plugin projects, and will install artefacts into you local maven repository
  • You can now use the tools of your choice to explore, use and modify the SDO source code. If you have extracted your source tree using SVN you will be able to submit patches arising from your modifications to the SDO project by attaching patch files to JIRAs.

Setting up for Eclipse Development

Follow the instructions above for setting up a maven development environment
Having ensured you have network access to the internet, in each of the following directories

  1. spec/sdo-api
  2. sdo/impl
  3. sdo/tools
    (Note: experienced eclipse users may want to select just a subset of these projects)

execute the command mvn -Peclipse eclipse:eclipse

Then

  • Start up eclipse
  • Switch to the Java perspective
  • Execute "File => Import ... => General => Existing project into workspace
  • Click "Browse ..." Navigate to the spec/sdo-api directory and click OK
  • Select the sdo-api project and click OK
  • After Eclipse has built the project you will see that there are compile errors. This is because Maven has created build dependencies for the project on the contents of your maven repository, but Eclipse doesn't yet know where that repository is. You must create and assign a value to the M2_REPO variable within eclipse to resolve these dependencies
    • Right click in the Package Explorer frame on the root of the newly created project and select Properties => Java Build Path
    • Click on the "Libraries" tab and select "Add Variable...", "Configure Variables ...", "New ..."
    • Set Name to M2_REPO and Click on "Folder..."
    • Navigate to the "repository" folder/directory (on Windows this is \Documents and Settings\<user>\.m2\repository, on Linux it is ~/.m2/repository) and click OK
    • Accept the request for doing a full rebuild
    • Cancel away from the "Configure Variables" dialog
    • Click "OK" on the Project Properties Window
    • When building is complete the project should now have no errors

Now repeat the same instructions for importing the sdo-impl and sdo-tools projects into the eclipse environment. You aklready have the M2_REPO variable defined now, so these projects should build OK.

At this point you have three separate projects each dependent on binary artifacts in your maven repository. Don't be tricked into thinking that
if you modify the sdo-impl project, that those changes will be picked up by the sdo-tools project. If you want this behaviour then follow these steps

  • In the package exlporer pane of the Java perspective, Right Click on Properties and select the libraries tab
  • Select the M2_REPO/commonj/sdo-api* library entry and click "remove"
  • Select the Projects tab and click "Add..."
  • Select the SDO API project and click OK
  • If you plan to work in the tools project
    • Select the "Order and Export" tab and select the sdo-api project and click OK (this means that the sdo-impl project will expose the interfaces of the sdo-api project, so that you don't have to import them into projects which depend on the sdo-impl project)
    • Repeat the above instructions, removing the sdo-api and sdo-impl library dependencies from the tools project, and adding a project dependency for the sdo-tools project on the sdo-impl project
  • No labels