bnd
bnd copied to clipboard
biz.aQute.launcher imports "impossible" packages
If i download this released jar here:
https://mvnrepository.com/artifact/biz.aQute.bnd/biz.aQute.launcher/7.1.0
the manifest contains:
Import-Package aQute.launcher.agent
aQute.launcher.pre
but these seem to be nowhere exported, instead they are part of an embedded jar named biz.aQute.launcher.pre.jar, leading to problems like:
Missing requirement: biz.aQute.launcher 7.1.0.202411251545 (biz.aQute.launcher 7.1.0.202411251545) requires 'java.package; aQute.launcher.agent 0.0.0' but it could not be found
if one tires to include that in a runtime.
Also org.osgi.framework [1.8.0,1.9.0) seems problematic as we are now at 1.10 already
The launcher as bundle?
Ok that it should be fixed but I can't see a use case for the launcher to be a bundle?
The launcher as bundle?
At least it has Manifest headers that indicate it is a bundle :-)
I can't see a use case for the launcher to be a bundle?
Currently bndtools uses a quite nasty workaround by using https://github.com/bndtools/bnd/tree/master/biz.aQute.bnd.embedded-repo that effectively packs some jar into a bundle and then is extracted at runtime so they are available at runtime and can be shipped with the IDE. This requires a quite "fat" monolith of 6MB that can not be updated independently.
What I instead often do is to install such things as a bundle in the runtime (even though it not actually "executes" anything) and then fetch the bundle location (see for an example here) and then it can be used as a jar (e.g. to fork an independent process) but one can still update it like a regular bundle. The other neat effect is, that by inspecting the wires one can compute a runtime class-path to launch such bundle.
So for that purpose it would even be ok it it just do not import/export anything at all and just has a BSN a Version and Main-Class attribute :-)
Why not get these constituents from a repo? They are all on Maven Central now?
This was a solution before the repos were as ubiquitous as they are now. Maybe we should get rid of this embedded repo?
Why not get these constituents from a repo? They are all on Maven Central now?
Yes I try to consume them from central (and Tycho actually already does it), but the problem for bndtools (and pde where I currently try to integrate this) is that in order to put it into an update-site (so P2 can 'install') them is that it fails because P2 think there is a missing requirement (the biz.aQute.launcher 7.1.0.202411251545 (biz.aQute.launcher 7.1.0.202411251545) requires 'java.package; aQute.launcher.agent 0.0.0' but it could not be found), so thats why I opened the ticket here.
Ok, fixing seems a good idea anyway ... bad metadata is worse than no metadata
Are you going to provide a PR?
@laeubi Do you still need this? Can you provide or help with a PR?
This is still needed, but it seems more suitable to be solved by someone more familiar with the bnd-magic used here to create the jar.
@laeubi I can help, but need your input. Let's have a call next week or so.