Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

biz.aQute.launcher imports "impossible" packages #6476

Open
laeubi opened this issue Feb 19, 2025 · 6 comments
Open

biz.aQute.launcher imports "impossible" packages #6476

laeubi opened this issue Feb 19, 2025 · 6 comments

Comments

@laeubi
Copy link
Contributor

laeubi commented Feb 19, 2025

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.

@laeubi
Copy link
Contributor Author

laeubi commented Feb 19, 2025

Also org.osgi.framework [1.8.0,1.9.0) seems problematic as we are now at 1.10 already

@pkriens
Copy link
Member

pkriens commented Feb 19, 2025

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?

@laeubi
Copy link
Contributor Author

laeubi commented Feb 19, 2025

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 :-)

@pkriens
Copy link
Member

pkriens commented Feb 20, 2025

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?

@laeubi
Copy link
Contributor Author

laeubi commented Feb 20, 2025

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.

@pkriens
Copy link
Member

pkriens commented Feb 20, 2025

Ok, fixing seems a good idea anyway ... bad metadata is worse than no metadata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants