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 "SMILA/Development Guidelines/How to set up integration environment"

(Create a launch configuration for SMILA)
(Install the binary distribution)
Line 11: Line 11:
 
==== Install the binary distribution ====
 
==== Install the binary distribution ====
  
Normally you should work with some stable version of SMILA - either a release or a milestone. Since our first milestone M1 was not properly prepared for this kind of development you will have to work with some nightly build (we've fixed things there) as long as we do not publish our second milestone M2.
+
Just pick up the latest stable version of SMILA - either a release or a milestone.
  
Pick up the latest nightly binary from: [http://build.eclipse.org/rt/smila/nightly http://build.eclipse.org/rt/smila/nightly]
+
The latest stable version can always be found in our [http://www.eclipse.org/smila/downloads.php download section].
  
Unzip the file you downloaded into a new directory on your local hard disk.
+
Simply unzip the file you downloaded into a new directory on your local hard disk and you've done with the installation.
  
 
==== Create a new Workspace and setup target platform ====
 
==== Create a new Workspace and setup target platform ====

Revision as of 17:29, 26 June 2009

This how-to describes the necessary steps for setting up SMILA integration environment. Normally this setup is only interesting for SMILA integrators who just want to integrate their components in SMILA. SMILA committers and contributors should work with another setup described at How to set up the development environment.

Preconditions

Here is the list of things that you will definitely need for developing SMILA components:

  1. JDK 1.5 or newer - We successfully use both 1.5 and 6
  2. current Eclipse SDK - This how-to was tested with Eclipse Classic 3.4.2
  3. SMILA binary distribution

Install the binary distribution

Just pick up the latest stable version of SMILA - either a release or a milestone.

The latest stable version can always be found in our download section.

Simply unzip the file you downloaded into a new directory on your local hard disk and you've done with the installation.

Create a new Workspace and setup target platform

Start your Eclipse SDK and let it create a new workspace at a location of your choice. Then you use the SMILA binaries as the target platform for plugin develoment. This enables you to create own bundles that can use the code in the SMILA bundles:

  • Open Windows -> Preferences
  • Select Plugin Development -> Target Platform
  • Enter the directory where you installed SMILA in the "Location" slot of the dialog (do not press <Enter>)
  • Click the "Reload" Button. The SMILA bundles should be listed in the Plugins tab:

SMILA-integrator-target-platform.png

  • Click OK.

Create a launch configuration for SMILA

  • Open the "Run" menu and select "Run Configurations ..." or "Debug Configurations ..."
  • Create a new configuration under "OSGi framework" by selecting it and using "New" from the context menu. It should look like this:

SMILA-integrator-launch-bundles.png

  • Select the "Arguments" tab.
  • In the "VM arguments" text field, add:
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
-Dlog4j.configuration=file:log4j.properties 
-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.port=9004
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.authenticate=false
  • Under "Working Directory" select "Other:" and enter: ${target_home}. It now should look like this:

SMILA-integrator-launch-arguments.png

  • After clicking the "Run" or "Debug" button at the bottom, SMILA will be started. After a while, some output should appear in the Console view:

SMILA-integrator-console.png

  • You should shutdown SMILA by entering "close" and <Enter> in the Console view.
  • There can be error messages in the console output or SMILA.log file that come from bundles that have been started (because in this setup ALL bundles are started), but are missing a configuration in the sample setup. These can be ignored. Alternatively you can deactivate them in the launch configuration.

Testing your code

To be able to use JUnit test your code, you will need to add a JUnit bundle to the target platform. You can do this by copying the directory plugins/org.junit_3.8.2.v20080602-1318 (the exact version numbers may vary in your installation) from your Eclipse installation to SMILA/plugins. You then need to press "Reload" again in the Target Platform pane of Window->Preferences to enable the JUnit bundle.

You may want to check out org.eclipse.smila.test from our SVN repository at http://dev.eclipse.org/svnroot/rt/org.eclipse.smila/. It contains some base classes for testing OSGi services and JMX agents. There are a lot of bundles named *.test in the repository that can serve you as an example of how to create test cases for crawlers and pipelets.

Back to the top