-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
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 #1173
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this change, this made it already much simpler to use the original Guice artifacts in OSGi.
@@ -339,8 +339,9 @@ See the Apache License Version 2.0 for the specific language governing permissio | |||
<plugin> | |||
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the meantime 5.1.8
was made available.
<configuration> | ||
<excludeDependencies>jsr305</excludeDependencies> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
_versionpolicy
instruction (deprecated) should now be_consumer-policy
in headers from the main jar. This overwrites the custom 'no_aop' headers
so we need to exclude
Bundle-Name
andImport-Package
from 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.