I'm using BndTools (http://bndtools.org/) to develop an OSGI application. Everything is working fine but I have some things I would like to change while exporting my app.
I'm trying to achieve two things (I think they may be related):
1: Replace the default BndTools launcher (aQute.launcher
) with a custom one (Or have it in .JAR
format)
How can I get rid or change the default BndTools launcher (aQute.launcher) to a custom one?
The only thing I could find out on this topic is here: http://goo.gl/jYliih
Launchers are not build into bnd, the actual launching strategy is parameterized. A launcher is associated with a bnd or bndrun file by placing a JAR on the
-runpath
. A.JAR
should have a Launcher-Plugin header to be a launcher. If no launcher is found on the-runpath
then the built-inbiz.aQute.launcher
will be used.
The reason is that I need my app to accept command args and not interfere with the aQute launcher ones (Like all -run args). On the other hand I would like to get rid of the batch .bat/.sh
approach of launching the app and use a single .jar
file to launch the app.
Is that possible?
2: Customize the exported file structure
By default BndTools creates this file structure when it exports the app:
jar/
-> This is the OSGI jar bundles folder
aQute/
-> The default BndTools Launcher (Launcher.class inside)
META-INF/
-> Why is there a META-INF folder here? It's not a JAR
launcher.properties
-> Launcher properties
start.sh
--> Launches the Launcher.class from this batch files.
start.bat
/ Where is the benefit of this in comparison of a JAR?
Basically I would like to remove the aQute
, META-INF
and start.*
files and add a bin
folder for binary files.
This should be possible to achieve with a "Ant", "Maven" or "Gridle" script. But I can just create a "BndTools Project" or a "Gradle Project" with no BndTools support. I installed the "BndTools Gradle plugin" but I couldn't find any useful documentation on this topic anywhere.
Hope somebody can help me out or point me to the right direction with this. Greetings.