Skip to content

Commit

Permalink
Completely remove OSGi Import-Package 'javax.annotation'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
HannesWell authored and Guice Team committed Apr 25, 2023
1 parent 8edbe68 commit e17e8af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<configuration>
<instructions>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Import-Package>!org.objectweb.asm.*,!com.google.inject.*,*</Import-Package>
<Import-Package>!org.objectweb.asm.*,!com.google.inject.*,!javax.annotation,*</Import-Package>
<Eclipse-ExtensibleAPI>true</Eclipse-ExtensibleAPI>
</instructions>
</configuration>
Expand Down
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,8 @@ 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>5.1.2</version>
<version>5.1.8</version>
<configuration>
<excludeDependencies>jsr305</excludeDependencies>
<instructions>
<module>com.google.inject</module>
<_include>-${project.basedir}/build.properties</_include>
Expand All @@ -355,7 +354,7 @@ See the Apache License Version 2.0 for the specific language governing permissio
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Bundle-SymbolicName>$(module)</Bundle-SymbolicName>
<Bundle-RequiredExecutionEnvironment>JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
<Import-Package>!com.google.inject.*,*</Import-Package>
<Import-Package>!com.google.inject.*,!javax.annotation,*</Import-Package>
<_exportcontents>!*.internal.*,$(module).*;version=${guice.api.version}</_exportcontents>
<_consumer-policy>$(version;==;$(@))</_consumer-policy>
<_nouses>true</_nouses>
Expand Down

0 comments on commit e17e8af

Please sign in to comment.