Skip to content
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

Conversation

mcculls
Copy link
Contributor

@mcculls mcculls commented Apr 3, 2018

  • _versionpolicy instruction (deprecated) should now be _consumer-policy
  • forked builds (like the 'no_aop' munged build) will now attempt to merge
    in headers from the main jar. This overwrites the custom 'no_aop' headers
    so we need to exclude Bundle-Name and Import-Package from this merging
    in 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.

mcculls added a commit to sonatype/sisu-guice that referenced this pull request Apr 3, 2018
@mcculls mcculls force-pushed the fix-osgi-metadata-after-bundleplugin350-upgrade branch 2 times, most recently from 83497d6 to a3a83ff Compare August 15, 2021 22:52
 * _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)
@mcculls mcculls force-pushed the fix-osgi-metadata-after-bundleplugin350-upgrade branch from a3a83ff to 9ebf53b Compare August 16, 2021 00:31
@mcculls mcculls changed the title Fix two minor OSGi metadata issues caused by upgrade to bundleplugin 3.5.0 Fix minor OSGi metadata issues caused by upgrade to bundleplugin 3.5.0 Aug 16, 2021
copybara-service bot pushed a commit that referenced this pull request Apr 19, 2023
PiperOrigin-RevId: 525559200
Copy link
Contributor

@HannesWell HannesWell left a 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>
Copy link
Contributor

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>
Copy link
Contributor

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.

copybara-service bot pushed a commit that referenced this pull request Apr 25, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants