Skip to content

Commit

Permalink
Make JSON imports optional in OSGi environments
Browse files Browse the repository at this point in the history
When deploying in OSGi containers the Jedis bundle has two hard requirements on having
the GSON and JSON bundles around. Since these depenendencies are optional we mark
the imports as such in the OSGi manifest.

If these packages are not exported the bundle will be installed and will be unable to
make use of the JSON functionality. When they are present they will be used.

Additionally, allow newer version of the org.json bundle to be used without requiring
a new release of Jedis.
  • Loading branch information
rombert committed Sep 27, 2024
1 parent 251831c commit 81d4678
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,19 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.9</version>
<configuration>
<instructions>
<!--
Ensure JSON dependencies are not required at run-time in OSGi environments and also
allow usage of newer org.json versions.
-->
<Import-Package>
com.google.gson;resolution:=optional,
org.json;resolution:=optional;version="20240303.0",
*
</Import-Package>
</instructions>
</configuration>
<executions>
<execution>
<id>bundle-manifest</id>
Expand Down

0 comments on commit 81d4678

Please sign in to comment.