-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
Prevent generation of Substitution Packages (Import-Package) without version #6267
Comments
I got something working to remove substitution packages (Imports) without versions but then the following testcase fails https:/bndtools/bnd/blob/master/biz.aQute.bndlib.tests/test/test/BuilderTest.java#L454 This testcase currently produces and expects the following Manifest:
The question is: what can we do? @pkriens UPDATE: I updated the testcase to include a version in the exports. So this testcase passes again. I added another testcase which checks the missing version case too then. |
In general if no version range can ultimately derived for whatever reason, then it should be an error / warning and not be imported at all. Given that the test-case you presented makes wrong assumption, the resulting manifest is wrong (in terms of the spec) as it export and imports |
I don't know what to say here, but I just remember this statement for a PR which was rejected.
Good point. This underlines the intent of this issue and also that the testcase should be adjusted as I have done in PR #6270
Where would you want to see that warning / error?
this is done in #6270 Could you maybe review PR #6270 too? |
Problem
In #6220 a problem was reported that bnd has generated an Import-Package header for
created an Import-Package for
com.google.gson.annotations
without a version range :Note: the version on the
Export-Package
s (2.11.0
) was taken from theBundle-Version
header, which is some kind of last-resort when no version is provided on the exports (not good OSGi practise but very common in the wild for library bundles who "just" want to add OSGi meta data via bnd)Expected result
As discussed in the call today with @pkriens it was disucssed that in the case above
com.google.gson.annotations
should NOT appear in theImport-Package
because it has no version.Related OSGi spec sections
The text was updated successfully, but these errors were encountered: