[ODLPARENT-185] Remove duplicate BouncyCastle packaging Created: 02/Jan/19  Updated: 04/Jan/19  Resolved: 04/Jan/19

Status: Resolved
Project: odlparent
Component/s: Karaf
Affects Version/s: None
Fix Version/s: 4.0.8, 3.1.6

Type: Improvement Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Our current packaging results in BC jars being packaged twice:

  1. in lib/{boot,ext}, where they are available to karaf bootstrap, which uses them to add the crypto provider
  2. in system/, where they are referenced via startup.properties, which populates their contents to the OSGi world

This is less than optimal, as the classes end up being loaded twice, where we really should be exposing BC packages from lib/boot through system.bundle's exports.

That way we have exactly one copy, that in the boot class loader, and have its packages re-exported to the OSGi world.



 Comments   
Comment by Robert Varga [ 02/Jan/19 ]

One way of doing this is through org.osgi.framework.system.packages.extra, but that requires a static list – which feels very flaky.

A better approach is to use framework extension bundles, as detailed in https://community.oracle.com/blogs/ss141213/2009/05/29/use-framework-extension-bundles-glassfish-v3 and https://spring.io/blog/2009/01/19/exposing-the-boot-classpath-in-osgi/ . What we need to do here is to create an empty fragment bundle, which will attach to system.bundle and contain all Export-Package declarations from bcprov/bcpkix.

We should be able to do this via some maven-level trickery and then have the fragment bundle specified in startup.properties.

 

Generated at Wed Feb 07 20:27:52 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.