-
-
Notifications
You must be signed in to change notification settings - Fork 302
Improve warning for optional Imports w/o version #6559
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
base: master
Are you sure you want to change the base?
Improve warning for optional Imports w/o version #6559
Conversation
Just for me: I observed the following: Assume:
Then I get:
and the MANIFEST.MF only contains:
But I actually have Now I add the jackson lib to my buildpath:
or even
(Even though my own code in the bundle does NOT use Then MANIFEST.MF contains the version:
I wonder if this is the way it is supposed to work. |
I asked chatGPT and I believe the answer is correct. Thus I am closing the PR now.
After thinking about it this way I think it makes sense. Closing. |
Although ChatGPT gave you a general answer, a specific example could be: what is you have two versions of the dependency in your workspace? Which version range should it use (especially if they have different major versions)? I'm curious though: Bnd is smart enough to include imports for transitive dependencies that are required at runtime but not in the build path. But if you're building with proper bundles as your buildpath artifacts, then those transitive dependencies should be listed in one of those bundles' import package statements, which should have the correct version range, which Bnd will then use. If I'm correct, then I'm guessing that your buildpath had a jar on it that either wasn't a bundle, was missing the import package for the annotation package, or was missing the import range for the transitive package? |
Yes I think you are correct.
It makes sense now. |
This suppresses the pedantic warning "Imports that lack version ranges" for the case of resolution:=optional imports. The idea behind this is, that if the developer has made the effort to customize the imports, then the developer has "handled" or "touched" that package. And one could argue the developer could have added a version too. But since the developer decided to only add resolution:=optional, then the version is probably not known or not important Signed-off-by: Christoph Rueger <chrisrueger@gmail.com> Revert "supress warning for optional Imports w/o version" This reverts commit 1616420. add more info to warning
1616420
to
4a0d294
Compare
@kriegfrj I reopened the PR and changed it so that I just add an explanation to the warning. |
This is an attempt / idea to improve the pedantic warning "Imports that lack version ranges" .