Skip to content

Commit

Permalink
Fix two minor OSGi metadata issues caused by upgrade to bundleplugin …
Browse files Browse the repository at this point in the history
…3.5.0:

 * _versionpolicy instruction 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.

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 allowed due to an unnecessarily strict range, because our
relaxed policy wasn't picked up. Whereas the second issue is more cosmetic and is
about preserving the custom 'no_aop' name and its simpler imports.
  • Loading branch information
mcculls committed Aug 15, 2021
1 parent 7d7e3da commit 83497d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Import-Package>!org.objectweb.asm.*,!com.google.inject.*,*</Import-Package>
<Eclipse-ExtensibleAPI>true</Eclipse-ExtensibleAPI>

<!-- keep these headers separate between the main build and the 'no_aop' munged build -->
<Merge-Headers>!Bundle-Name,!Import-Package</Merge-Headers>
</instructions>
</configuration>
</plugin>
Expand Down
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,15 @@ See the Apache License Version 2.0 for the specific language governing permissio
<Bundle-RequiredExecutionEnvironment>JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
<Import-Package>!com.google.inject.*,*</Import-Package>
<_exportcontents>!*.internal.*,$(module).*;version=${guice.api.version}</_exportcontents>
<_versionpolicy>$(version;==;$(@))</_versionpolicy>
<_consumer-policy>$(version;==;$(@))</_consumer-policy>
<_nouses>true</_nouses>
<_removeheaders>
Embed-Dependency,Embed-Transitive,
Built-By,Tool,Created-By,Build-Jdk,
Originally-Created-By,Archiver-Version,
Include-Resource,Private-Package,
Ignore-Package,Bnd-LastModified
Ignore-Package,Bnd-LastModified,
Merge-Headers
</_removeheaders>
</instructions>
</configuration>
Expand Down

0 comments on commit 83497d6

Please sign in to comment.