What version are we talking about? If you version a package in bnd with 1.2.3.XXXXX then this is the package version you will get as export.
However, by default bnd strips the qualifier when it creates the import range based on the export. You should be able to override this with the version policy. The defaults are:
-provider-policy = ${range;[==,=+)}
-consumer-policy = ${range;[==,=+)}
You can easily change them to include the qualifier.
However, that would be a global change and I expect you regret this.
So the other solution is to modify the import of this bad package:
Import-Package org.myproject;version="${range;[====.=+);${@}}", *
Of course the easiest solution is to get it over with and accept that putting lip stick on a pig does not make it semantically versioned. Just separate the version from YOUR bundle with the dependency. In those cases I tend to pick a weird major number, e.g. 100, to make clear that my version is NOT the target's version.
Since I've some nasty memories of those projects I could also advice you to take a look at the OSGi contracts. With contracts you do not version the packages but you use a contract requirement.
And then the last, and definitely the best, do you real need that project to be versioned? I find that in most cases it is more than worth to develop my own OSGi API that reflects my need of this external target. Then I can leave that package nicely hidden in a dark place where it should probably suffer for not being semantically versioned :-)
1.0.2
, and then the writers oforg.myproject
make some changes in addition to the ones I've already included and call that1.0.2
, we're in a bit of a pickle no? If I want to wrap their new version, what version would I call that? – Dan Gravellbnd
orbndtools
to generate export statements with them in? – Dan Gravell