You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by nk...@apache.org on 2021/08/03 09:41:35 UTC

[zookeeper] branch branch-3.6 updated: ZOOKEEPER-4331: add headers back in osgi artifact

This is an automated email from the ASF dual-hosted git repository.

nkalmar pushed a commit to branch branch-3.6
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/branch-3.6 by this push:
     new b66d0a4  ZOOKEEPER-4331: add headers back in osgi artifact
b66d0a4 is described below

commit b66d0a477181c7b9d7600d468e49421f43355e25
Author: Wu, Xiaokai (Marvin) <ma...@ea.com>
AuthorDate: Tue Aug 3 11:37:43 2021 +0200

    ZOOKEEPER-4331: add headers back in osgi artifact
    
    Following up https://github.com/apache/zookeeper/pull/1722, I'm applying the change on master instead of 3.5.x as advised.
    
    As an alternative to https://github.com/apache/zookeeper/pull/1726, this change employs bundle plugin to build another artifact of classifier "osgi".
    
    The advantage would be bundle plugin remains employed to maintain the topology of versioned packages, and the original artifact without classifier is left untouched.
    
    The disadvantage would be we've one more artifact delivered in this project.
    
    ```
    $ ls zookeeper-server/target/ | grep jar$
    zookeeper-3.5.9.jar
    zookeeper-3.5.9-javadoc.jar
    zookeeper-3.5.9-osgi.jar
    zookeeper-3.5.9-sources.jar
    zookeeper-3.5.9-tests.jar
    ```
    
    Author: Wu, Xiaokai (Marvin) <ma...@ea.com>
    
    Reviewers: Enrico Olivelli <eo...@apache.org>, Norbert Kalmar <nk...@apache.org>
    
    Closes #1727 from bigmarvin/ZOOKEEPER-4331/add-new-osgi-artifact
    
    (cherry picked from commit 9a5da5f9a023e53bf339748b5b7b17278ae36475)
    Signed-off-by: Norbert Kalmar <nk...@apache.org>
---
 pom.xml                  |  5 +++++
 zookeeper-jute/pom.xml   | 32 ++++++++++++++++++++++++++++++++
 zookeeper-server/pom.xml | 46 +++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 82 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 0931df5..8eb7b73 100755
--- a/pom.xml
+++ b/pom.xml
@@ -703,6 +703,11 @@
             </execution>
           </executions>
         </plugin>
+        <plugin>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>maven-bundle-plugin</artifactId>
+          <version>4.1.0</version>
+        </plugin>
       </plugins>
     </pluginManagement>
 
diff --git a/zookeeper-jute/pom.xml b/zookeeper-jute/pom.xml
index 2a781a4..e00a21f 100755
--- a/zookeeper-jute/pom.xml
+++ b/zookeeper-jute/pom.xml
@@ -151,6 +151,38 @@
             <skip>true</skip>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>build bundle</id>
+            <phase>package</phase>
+            <goals>
+              <goal>bundle</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <instructions>
+            <Import-Package>
+              *;resolution:=optional
+            </Import-Package>
+            <Export-Package>
+              org.apache.zookeeper.data,
+              org.apache.zookeeper.proto,
+              org.apache.zookeeper.txn,
+              !org.apache.zookeeper*,
+              org.apache.jute*
+            </Export-Package>
+            <Bundle-Name>ZooKeeper Jute Bundle</Bundle-Name>
+            <Bundle-DocURL>https://zookeeper.apache.org/doc/current/</Bundle-DocURL>
+            <Implementation-Build>${mvngit.commit.id}</Implementation-Build>
+            <Merge-Headers>!Implementation-Build,*</Merge-Headers>
+          </instructions>
+          <classifier>osgi</classifier>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 
diff --git a/zookeeper-server/pom.xml b/zookeeper-server/pom.xml
index 82f17ef..94a0bb5 100755
--- a/zookeeper-server/pom.xml
+++ b/zookeeper-server/pom.xml
@@ -273,7 +273,51 @@
           </systemPropertyVariables>
         </configuration>
       </plugin>
-	  
+
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>build bundle</id>
+            <phase>package</phase>
+            <goals>
+              <goal>bundle</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <instructions>
+            <Import-Package>
+              io.netty.buffer;resolution:=optional,
+              io.netty.channel;resolution:=optional,
+              io.netty.channel.group;resolution:=optional,
+              io.netty.channel.socket.nio;resolution:=optional,
+              javax.management;resolution:=optional,
+              javax.security.auth.callback,
+              javax.security.auth.login,
+              javax.security.sasl,
+              org.ietf.jgss,
+              org.osgi.framework;resolution:=optional,
+              org.osgi.util.tracker;resolution:=optional,
+              org.slf4j,
+              *;resolution:=optional
+            </Import-Package>
+            <Export-Package>
+              !org.apache.zookeeper.data,
+              !org.apache.zookeeper.proto,
+              !org.apache.zookeeper.txn,
+              org.apache.zookeeper*
+            </Export-Package>
+            <Bundle-Name>ZooKeeper Bundle</Bundle-Name>
+            <Bundle-DocURL>https://zookeeper.apache.org/doc/current/</Bundle-DocURL>
+            <Implementation-Build>${mvngit.commit.id}</Implementation-Build>
+            <Merge-Headers>!Implementation-Build,*</Merge-Headers>
+          </instructions>
+          <classifier>osgi</classifier>
+        </configuration>
+      </plugin>
+
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>