This project is a very lightweight OSGi launcher, based on the powerful Apache Felix framework. This solution streamlines the process of bundle resolution and deployment by using the Maven dependency management system. An additional configuration layer over Apache Felix simplifies sharing of dependencies and bundles across the services.
Download new versions from the Git repository: https://github.com/OpaliaSystems/osgi-launcher
The launcher can be easily embedded into an existing application or run as a standalone application.
To keep it simple the build tool can be used to boot the application.
mvn exec:java -Dexec.args="..."
If the application is running in the foreground the shortcut Ctrl+C causes a graceful shutdown. In case the application is running in the background, the following command can be used.
kill -s TERM $(cat ./path/to/application.pid)
The configuration is taken from the system properties. Alternatively, the configuration can be specified in files.
--config-file=application.properties --config-file=another.properties
In case the artifacts should only be resolved and installed to test their compatibility, a dry-run can be performed, which skips starting the bundles.
--dry-run
Defaults | Description |
---|---|
launcher.forced-root-log-level |
|
The default is the log-level of root logger in log4j2.xml file. |
This property forces the application to overwrite the log-level of the configured root logger. |
launcher.auto-shutdown |
|
using embedded launcher: |
If true the launcher creates a shutdown hook to gracefully end the application. It is required to perform correctly if the application gets a signal to shutdown. |
launcher.auto-deployment |
|
|
Enables or disables auto-deployment. |
launcher.auto-deployment-directory |
|
|
The path to the auto-deployment directory. Drop bundles into this directory at runtime for automatic deployment. |
launcher.cache-directory |
|
|
The path to the Apache Felix cache directory. |
launcher.pid-file |
|
|
The path to the PID file, which will be created by the launcher. This file can be used to end the application. |
launcher.extra-export-packages |
|
if logging service is enabled: |
A comma-separated list of packages that should be exported to be available for all bundles. |
launcher.bundle-artifacts |
|
<empty> |
A comma-separated list of bundle artifacts that will be installed at boot time. |
launcher.remote-repositories |
|
|
A comma-separated list of Maven repositories used for resolving bundle artifacts. The remote repositories are only used if the local repository does not have an entry for a specific bundle artifact. |
launcher.local-repository |
|
<user.home> |
The path to a local Maven repository. |
launcher.provide-service.logging |
|
|
If true the logging framework becomes available for all bundles via the OSGi logging interface. Instead of using the logging factory directly, a bridge implementation can be used to operate the logging facade SLF4J over the OSGi logging facade. |
log4j.configurationFile |
|
The default configuration file log4j2.xml is directly available from JAR resources. |
Allows to set an alternative configuration file for Log4j 2. May also contain a comma-separated list of configuration file paths. |
Copyright (c) 2022 Eric Löffler (brettaufheber)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.