Move Kryo shading to atomix-storage 03/104703/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 2 Mar 2023 10:39:08 +0000 (11:39 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 2 Mar 2023 10:40:12 +0000 (11:40 +0100)
sal-akka-segmented-journal should not need to deal with Kryo, make sure
we contain the hacks at the source of the problem.

JIRA: CONTROLLER-2071
Change-Id: I0e82b532889babeacd47aade33268886620811d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-akka-segmented-journal/pom.xml
third-party/atomix/storage/pom.xml

index 93fef5cda79ab9c1f5d45dddf3c77e79b31fdb08..dc77829936c2ef36e64d36c75bc96014752d474c 100644 (file)
@@ -65,37 +65,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>atomix-storage</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.esotericsoftware</groupId>
-            <artifactId>kryo</artifactId>
-            <version>4.0.2</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.esotericsoftware</groupId>
-            <artifactId>minlog</artifactId>
-            <version>1.3.1</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.esotericsoftware</groupId>
-            <artifactId>reflectasm</artifactId>
-            <version>1.11.8</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ow2.asm</groupId>
-            <artifactId>asm</artifactId>
-            <version>5.2</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.objenesis</groupId>
-            <artifactId>objenesis</artifactId>
-            <version>2.6</version>
-            <scope>provided</scope>
         </dependency>
 
         <dependency>
@@ -110,34 +79,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
         </dependency>
     </dependencies>
 
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-                        <Import-Package>
-                            !COM.newmonics.*,
-                            !android.os,
-                            *
-                        </Import-Package>
-                        <Embed-Dependency>
-                            <!-- atomix.io is using an older Guava, and Kryo is using ancient objenesis,
-                                 so let's embed it to prevent duplicates -->
-                            *;inline=true;artifactId=atomix-storage,
-                            *;inline=true;groupId=com.esotericsoftware,
-                            *;inline=true;groupId=org.objenesis,
-                            *;inline=true;groupId=org.ow2.asm,
-                        </Embed-Dependency>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
     <scm>
         <connection>scm:git:http://git.opendaylight.org/gerrit/controller.git</connection>
         <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
index c077f156f49b2538bc1827a412368291da0d29c6..06501521433f74889d3480f9474761f49f3651e9 100644 (file)
@@ -26,6 +26,7 @@
 
   <artifactId>atomix-storage</artifactId>
   <name>Atomix Storage</name>
+  <packaging>bundle</packaging>
 
   <properties>
     <odlparent.checkstyle.skip>true</odlparent.checkstyle.skip>
       <groupId>com.esotericsoftware</groupId>
       <artifactId>kryo</artifactId>
       <version>4.0.2</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.esotericsoftware</groupId>
+      <artifactId>minlog</artifactId>
+      <version>1.3.1</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.esotericsoftware</groupId>
+      <artifactId>reflectasm</artifactId>
+      <version>1.11.8</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ow2.asm</groupId>
+      <artifactId>asm</artifactId>
+      <version>5.2</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.objenesis</groupId>
+      <artifactId>objenesis</artifactId>
+      <version>2.6</version>
+      <scope>provided</scope>
     </dependency>
 
     <dependency>
           <instructions>
             <Export-Package>
               io.atomix.storage.*,
-              io.atomix.utils.*
+              io.atomix.utils.*,
+              com.esotericsoftware.kryo.*;version=4.0.2
             </Export-Package>
             <Import-Package>
-              sun.nio.ch;resolution:=optional,sun.misc;resolution:=optional,*
+              sun.nio.ch;resolution:=optional,
+              sun.misc;resolution:=optional,
+              !COM.newmonics.*,
+              !android.os,
+              *
             </Import-Package>
+
+            <!-- Kryo is using ancient objenesis, so let's embed it to prevent duplicates -->
+            <Embed-Dependency>
+                *;inline=true;groupId=com.esotericsoftware,
+                *;inline=true;groupId=org.objenesis,
+                *;inline=true;groupId=org.ow2.asm,
+            </Embed-Dependency>
           </instructions>
         </configuration>
       </plugin>