There are no IDEs at the moment that support OSGi environment but Eclipse. Currently we use latest Eclipse 3.5 version (Eclipse 3 Keyboard Shortcuts).
There are no reasons to be not compatible with Java 5. Nevertheless, you may use Java 6 for development but don't forget to set 5.0 language compliance level.
SevenHats is an open source project so we use Eclipse built-in code style (default code style) to be compatible with Equinox and Spring projects we are based on.
We use Apache commons log factory that is configured to use log4j implementation. Again, that is how all Spring projects do.
The libraries, which are used from different bundles should be wrapped into a bundle and added to platform project.
- Navigate to File -> New -> Project -> Plug-in Development -> Plug-in from Existing JAR archives;
- Select JAR to be wrapped (by clicking 'Add' or 'Add External...'), click 'Next';
- Input bundle name, in 'Target Platform' group select 'an OSGI framework' radio-button. Check 'Analyze library contents and add dependencies'. Equinox must be selected in combo-box;
- Make sure that 'Unzip the JAR archives into the project' check-box is selected;
- Select 'Export -> Plug-in Development -> Deployable plug-ins and fragments' on the newly created project;
- Select platform as a Destination Directory;
- Restart Eclipse, rebuild projects. In Run Configuration select newly added library.
An http port for embedded Jetty can be specified by passing the following parameter to java:
-Dorg.eclipse.equinox.http.jetty.http.port=<The port number>
One of standard values is -Dorg.eclipse.equinox.http.jetty.http.port=8080.
To build SevenHats, please use buildAll target of Ant build file located at <SevenHats home>/Build/scripts/build.xml. This will run the dependecies check, compilation and tests (both unit and functional). It is recommended to run the build locally before checking in the changes.
For detailed process description please see this article
To launch SevenHats-based application you should go through the following procedure:
- Put all platform bundles into a single folder. Let's call it platform.
- Put all application bundles into another folder. Let's call it bundles.
- Create configuration file for this launch using createConfig ant task (see more details here). Sample ant build configuration file looks as follows:
- Launch framework with the following command:
where org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar is a eclipse launcher library (it may have different version: org.eclipse.equinox.launcher_1.0.1.R33x_vXXXXXXX.jar)