Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

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.

Getting Setup for Development (prerequisites)

Download the following:

Setting up for Maven Development

...

  • 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>specroot>/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.

...

  • 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

Digging into EMF

With EMF being such an integral part of SDO development, its often necessary to debug into the EMF code to understand what's going on. To do this you need to download an EMF SDK (runtimes, source, docs) for EMF, SDO and XSD (Don't be confused by the presence of SDO; the version 1 API used to be developed at Eclipse, and it is this that is being downloaded, you can safely ignore it). You'll need the corresponding EMF version to the Tuscany SDO source code (Currently EMF 2.2.2 as at March 2007). Take a look for the <emfVersion> tag in the sdo/pom.xml file to discover the current version dependency. Extract the downloaded archive to somewhere on your computer.

  • When eclipse opens up a .class file and presents you with an "Attach Source..." button, click it and the click "Variable ...", "New..."
  • Create a variable, e.g. EMF_SRC and set the value to a folder within your extracted EMF archive, e.g. C:/Development/downloads/emf-sdo-xsd-SDK-2.2.2/eclipse/plugins
  • Click OK to close the "Variable Selection" dialog
  • In the "Source Attachment Configuration" Dialog, click "Extension ..."
  • Navigate to the src.zip file corresponding to the class you are interested in. This will take a little bit of thought. Look at the package name for the class you are interested in and navigate to a zip file that would seem to correspond to that class, e.g. org.eclipse.emf.source_2.2.2.v200702131851/src/org.eclipse.emf.ecore_2.2.2.v200702131851/src.zip
  • You should now be able to set breakpoints and observe execution behaviour of the EMF code in the eclipse debugger