Question:
Should the version attribute of DynamicImport-Package
in a dependency included via -includeresource
be considered by bnd for calculating the Import-Package
header?
Scenario:
My Wrapper Bundle A:
-includeresource: \
${repo;io.micrometer:micrometer-core;latest}; lib:=true,\
Import-Package: *
Bnd finds, that this dependecy references com.github.benmanes.caffeine.cache
in its .class files. And also the dependency specifies a DynamicImport-Package
for that package with a version.
io.micrometer:micrometer-core:
DynamicImport-Package: com.github.benmanes.caffeine.cache;version="2.9.3"
which includes a versionrange >=2.9.3
But my build Wrapper Bundle A .jar’s MANIFEST.MF contains :
Import-Package: com.github.benmanes.caffeine.cache
WITHOUT a version.
The reason I ask is that I currently get a pendantic
warning
Imports that lack version ranges: [com.github.benmanes.caffeine.cache]
So my question is:
Is it correct that the Import-Package does not have a version?
Or could / should bnd theoretically use the information of DynamicImport-Package
somehow?
Or if not adding the version is ok, could I maybe try to suppress the pedantic
warning, if that bundle is part of a DynamicImport-Package
? (i read here that for DynamicImport-Package
the version is not that important)
E.g. there is Analyzer.getManifestInfoFromClasspath(Jar jar, Packages classpathExports, Contracts contracts)
where I would have access to the domain.getDynamicImportPackage()
If this is something bnd could / should handle I could start looking into a PR, but wanted to ask first.
Thoughts? @pkriens @bjhargrave