Hello everyone,
I’ve been trying to wrap an existing OSGI-bundle B, adding content in the process (yes has to be in the existing bundle) and maintain the original Bundle-Classpath (BCP).
My approach currently is that I unroll bundle B like so:
-includeresource: @B*.jar
This results in a wrapped bundle that contains all the data we want to have it contain. Unfortunately, by doing so the original BCP is lost.
I tried setting the BCP manually via:
Bundle-ClassPath: .,${lsr;./target/classes/;*.jar}
This approach only works if the bundle B was already unrolled previously, or in other words:
The includeresouce instruction is executed after the BCP-Header field is evaluated.
I am sure that I am missing something here but I couldn’t find another way of getting the correct result.
Does anybody know a better approach? Or how I could tell bndtools to evaluate the BCP-Header after the includeresource instruction?
Thank you very much and have a great weekend!
Nuw
P.S. I also tried out if I could use the -includeresource instruction to include and add the contained jars of the original bundle directly, but the lib:=true
flag doesn’t seem to work for files from within another depency.
Example:
-includeresource: \
@B*.jar!/!*.jar,\
@B*.jar!/*.jar;lib:=true