(This question was also asked in the bndtools group list)
I am a little confused, because the wishes that seem to be provided to you. You can export the bndrun file to a single executable JAR. In bndtools, you can access command line arguments by getting the Object service and then the launcher.arguments service property. This is the source string [] specified in the main launch method.
@Reference(target="(launcher.arguments=*)") void setArgs( Map<String,Object> args ) { … = (String[]) args.get( "launcher.arguments"; }
An exported JAR is an executable JAR. JPM can easily be converted to a local executable.
jpm install -n mycode mycode.jar
You can install jpm from http://jpm4j.org/#!/md/install .
Robert: Thank you, Peter, the code snippet of the argument on the command line is what I need.
About the folder structure:
I need my update packages. If I insert all the bundles inside the .Jar, then they cannot be updated. I just need to pack Launcher when you have the packages.
BndTools has two export options. 1, where you can embed the entire launcher and all packages within the same JAR. Or option 2 is to have packages inside the lib directory and run them using shell scripts (start.bat, start.sh). I am looking for a solution for a <script shell.
Peter: Even though the packages are inside, you can still update them until you clear the Frameworks storage area. You can easily enable File Install, for example, and download packages from a directory or use another Apache Ace management agent.
From my point of view, the current JAR export (I really do not like exporting directories at all, it's dirty) is just as good as it is. It has a very good release model, only one file that is easy to modify and update. Using JPM, you can install it on any system.
So, if you want something else, you will have to create your own exporter ...