curator
curator copied to clipboard
[CURATOR-432] OSGI bundles should not import org.apache.curator
Curator bundles will not deploy to an OSGI container like Karaf with an import requirement on a non-existent package. The problem is highlighted in the excerpt from the MANIFEST.MF below
Import-Package: com.google.common.base;version="[20.0,21)",com.google. common.collect;version="[20.0,21)",com.google.common.util.concurrent; version="[20.0,21)",*org.apache.curator;version="[4.0,5)"*,org.apache.c urator.framework;version="[4.0,5)",org.apache.curator.framework.api;v ersion="[4.0,5)",org.apache.curator.framework.api.transaction;version ="[4.0,5)",org.apache.curator.framework.imps;version="[4.0,5)",org.ap ache.curator.framework.listen;version="[4.0,5)",org.apache.curator.fr amework.state;version="[4.0,5)",org.apache.curator.retry;version="[4. 0,5)",org.apache.curator.utils;version="[4.0,5)",org.apache.zookeeper ;version="[3.5,4)",org.apache.zookeeper.data;version="[3.5,4)",org.sl f4j;version="[1.7,2)"
Originally reported by christopher-johnson, imported from: OSGI bundles should not import org.apache.curator
- assignee: randgalt
- status: Open
- priority: Minor
- resolution: Unresolved
- imported: 2025-01-21
Github user acoburn commented on the issue:
https://github.com/apache/curator/pull/237
I actually think the issue here is not with the `org.apache.curator/curator-client` bundle (which is an OSGi bundle), but rather with the underlying zookeeper bundle. The issue there is that ZK uses a dash in its versioning scheme (3.5.x-alpha or 3.5.3-beta) and that version becomes part of the `Bundle-Version` in the manifest file. OSGi versioning can't parse that dash; typically, in such situations the dash is replaced with a period for the `Bundle-Version` field in the manifest.
As an experiment, I re-wrapped the ZK bundle (using the version 3.5.3.beta). Then it became possible to deploy ZK 3.5 in Karaf, and once that was in place, all of the 4.0.0 Curator bundles could be both deployed and started in Karaf.
TL;DR – the Curator bundles are already in fine shape for OSGi, the issue is upstream with Zookeeper, which itself will be resolved as soon as the `-beta` is dropped from the version.
Github user christopher-johnson commented on the issue:
https://github.com/apache/curator/pull/237
the framework imports the root org.curator.* but the client does not. Any import dependency on the framework will fail.
Github user iocanel commented on a diff in the pull request:
https://github.com/apache/curator/pull/237#discussion_r160649759
— Diff: curator-framework/pom.xml —
@@ -100,6 +100,27 @@
+
+
+
+
+
+
+
+
— End diff –
There is no need to define the plugin again. The plugin is defined once in the parent pom and inherited from the rest of the modules.
To customize a modules configuration please set properties:
- `osgi.import.package`
- `osgi.export.package`