Fix minor OSGi metadata issues caused by upgrade to bundleplugin 3.5.0#1173
Fix minor OSGi metadata issues caused by upgrade to bundleplugin 3.5.0#1173mcculls wants to merge 1 commit intogoogle:masterfrom
Conversation
83497d6 to
a3a83ff
Compare
* _versionpolicy instruction should now be _consumer-policy (fixes guava import range) * exclude jsr305 dependency from analysis (so javax.annotation import is unversioned) * use latest bundleplugin (5.1.2)
a3a83ff to
9ebf53b
Compare
PiperOrigin-RevId: 525559200
HannesWell
left a comment
There was a problem hiding this comment.
Thank you for this change, this made it already much simpler to use the original Guice artifacts in OSGi.
| <groupId>org.apache.felix</groupId> | ||
| <artifactId>maven-bundle-plugin</artifactId> | ||
| <version>3.5.0</version> | ||
| <version>5.1.2</version> |
There was a problem hiding this comment.
In the meantime 5.1.8 was made available.
| <version>3.5.0</version> | ||
| <version>5.1.2</version> | ||
| <configuration> | ||
| <excludeDependencies>jsr305</excludeDependencies> |
There was a problem hiding this comment.
This removed the version range from the Package import javax.annotation;version="[3.0,4)", which is great because one does not need the jsr305 in an OSGi runtime anymore.
Nevertheless there is still the Import-Package javax.annotation (without version range) remains.
If the Nullable annotation from jsr305 is really not necessary at runtime I suggest to completely remove the import of the javax.annotation package, by adding a negated pattern to the Import-Package element.
If you are interested, I can provide a PR to change to that suggestion.
As suggested (and I assume also intended) in #1173 this PR changes the configuration of the maven-bundle-plugin to completely remove the import of the package `javax.annotation`, which seems not to be required at runtime. With PR #1173 respectively #1697 the OSGi package import of `javax.annotation;version="[3.0,4)"` was only changed to `javax.annotation`, i.e. the version range was removed. Additionally update to latest maven-bundle-plugin 5.1.8. Fixes #1708 COPYBARA_INTEGRATE_REVIEW=#1708 from HannesWell:removeJavaxAnnotation 968f4bc PiperOrigin-RevId: 527092811
_versionpolicyinstruction (deprecated) should now be_consumer-policyin headers from the main jar. This overwrites the custom 'no_aop' headers
so we need to exclude
Bundle-NameandImport-Packagefrom this mergingin the core build to keep those 'no_aop' differences.
Note: neither of these issues stop someone from deploying Guice 4.2 on OSGi.
It's just the first issue means they'd have to deploy a specific version of Guava.
Versions after 23.x wouldn't be accepted due to an unnecessarily strict range,
because our relaxed version policy wasn't picked up. Whereas the second issue
is more cosmetic and is about preserving the custom 'no_aop' bundle name and
its simpler imports.