EOSGi Eclipse plugin
EOSGi Eclipse plugin
EOSGi Eclipse plugin displays OSGi environments specified with eosgi-maven-plugin in the Project Explorer view of Eclipse and lets the user managing the environment by using a context menu. The user can:
If an OSGi environment is managed with the Eclipse plugin, dependencies are resolved from the workspace with the following algorithm: If a dependency is imported as a maven project into the workspace, the plugin executes mvn package on that dependency and installs the result JAR file to the OSGi container.
When an OSGi environment is started in debug mode by the plugin, the sources are resolved by the dependency manager of maven. If a dependency is available on the workspace as a project, the source is picked up from there.
org.apache.aries.jmx org.apache.aries.jmx.core 1.1.7 org.everit.osgi.jmx org.everit.osgi.jmx.activator 1.0.0
org.apache.felix org.apache.felix.configadmin 1.8.14
The eosgi-maven-plugin creates portable OSGi environments by default. The generated environments are placed to the target/eosgi/dist/ENVIRONMENT_ID/ directory of the maven project.
It is possible to add one or more specific OSGi environment configuration, just as it is described in the documentation of eosgi-maven-plugin. The developer can specify multiple environments with different OSGi frameworks, slightly different set of bundles and different launch configurations.
Add the following configuration to eosgi-maven-plugin to create a felix and an equinox environment:
org.everit.osgi.dev eosgi-maven-plugin 4.0.0 test_equinox equinox test_felix felix
Note that the list of environments changed in the project explorer of Eclipse.
In equinox there is a built-in LogService implementation that is necessary to satisfy the aries.jmx.core bundle (that is necessary to support hot deployment). There is no built-in LogService in case of Apache Felix Framework, therefore add it to the felix framework separately:
test_felix felix org.apache.felix:org.apache.felix.log:1.0.1
It is possible to specify any kind of VM arguments for the specific environments. Modify the configuration to add some environment specific system properties:
org.everit.osgi.dev eosgi-maven-plugin 4.0.0 test_equinox equinox -Dhello.message="I am an equinox environment" test_felix felix -Dhello.message="I am a felix environment" org.apache.felix:org.apache.felix.log:1.0.1
Test the availability of the system property anywhere (e.g.: in the start method of the bundle activator) with the following line:
System.out.println(System.getProperty("hello.message"));
It is possible to override arguments in the launch configuration based on their keys (the tag name) depending on the launch environment. E.g.: Override the value hello.message system property if it is launched from the IDE:
-Dhello.message="I am an equinox environment" IDE -Dhello.message="I am an equinox environment started from IDE"