Fix BouncyCastle packaging 85/97285/8
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 23 Aug 2021 09:06:01 +0000 (11:06 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 23 Aug 2021 12:34:33 +0000 (14:34 +0200)
BC-1.69 changed layout of artifacts, with a few things moving from
bcprov to the new bcutil artifact. Adjust packaging accordingly.

Since Karaf is also referencing bcpkix in the SSH feature, remove it,
since we are exposing it from boot class path -- which saves ~5.5MiB
on empty distribution.

JIRA: ODLPARENT-254
Change-Id: I6af80431966c10b31a27317c7aba55826616400e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
karaf/bcutil-framework-ext/pom.xml [new file with mode: 0644]
karaf/karaf-dist-static/pom.xml
karaf/karaf4-parent/pom.xml
karaf/opendaylight-karaf-resources/pom.xml
karaf/opendaylight-karaf-resources/src/main/patches/karaf-remove-bc.patch [new file with mode: 0644]
karaf/pom.xml
odlparent-artifacts/pom.xml
odlparent-dependency-check/pom.xml
odlparent/pom.xml
untested-single-feature-parent/pom.xml

diff --git a/karaf/bcutil-framework-ext/pom.xml b/karaf/bcutil-framework-ext/pom.xml
new file mode 100644 (file)
index 0000000..a420156
--- /dev/null
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright © 2021 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <parent>
+        <groupId>org.opendaylight.odlparent</groupId>
+        <artifactId>bundle-parent</artifactId>
+        <version>9.0.4-SNAPSHOT</version>
+        <relativePath>../../bundle-parent</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>bcutil-framework-ext</artifactId>
+    <packaging>bundle</packaging>
+    <name>ODL :: odlparent :: ${project.artifactId}</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcutil-jdk15on</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>unpack-dependencies</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <includes>**/MANIFEST.MF</includes>
+                            <includeArtifactIds>bcutil-jdk15on</includeArtifactIds>
+                            <silent>true</silent>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.opendaylight.odlparent</groupId>
+                <artifactId>filter-manifest-plugin</artifactId>
+                <version>${project.version}</version>
+                <executions>
+                    <execution>
+                        <id>filter-manifest</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>filter-manifest</goal>
+                        </goals>
+                        <configuration>
+                            <inputFile>${project.build.directory}/dependency/META-INF/MANIFEST.MF</inputFile>
+                            <outputFile>${project.build.directory}/MANIFEST.MF</outputFile>
+                            <retainedAttributes>
+                                <retainedAttribute>Export-Package</retainedAttribute>
+                            </retainedAttributes>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <_include>${project.build.directory}/MANIFEST.MF</_include>
+                        <Fragment-Host>system.bundle;extension:=framework</Fragment-Host>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
index eaffa3ccfdc9a8e623faf4349aacfb21d6e511f2..6f3d6182fa2f972f819028a093040fea42d653d5 100644 (file)
                 <groupId>org.bouncycastle</groupId>
                 <artifactId>bcprov-jdk15on</artifactId>
             </dependency>
+            <dependency>
+                <groupId>org.bouncycastle</groupId>
+                <artifactId>bcutil-jdk15on</artifactId>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 
index 2176abed9503e459820c7ffad68e6a32ef89f11e..10b4fb1324500c77ba13e68e365e9b174e2f56f9 100644 (file)
             <artifactId>bcprov-framework-ext</artifactId>
             <scope>runtime</scope>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.odlparent</groupId>
+            <artifactId>bcutil-framework-ext</artifactId>
+            <scope>runtime</scope>
+        </dependency>
     </dependencies>
 
     <build>
                             </target>
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>remove-system-bc</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <target>
+                                <delete dir="${project.build.directory}/assembly/system/org/bouncycastle"
+                                    includeemptydirs="true" failonerror="true"/>
+                            </target>
+                        </configuration>
+                    </execution>
                 </executions>
             </plugin>
             <plugin>
index b4ed12de12a3accb55fc1cf6813db629c6784dcc..cf8b52564c5bcf377cd536ab93d3c5a19344c6c1 100644 (file)
       <artifactId>bcprov-framework-ext</artifactId>
       <scope>runtime</scope>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.odlparent</groupId>
+      <artifactId>bcutil-framework-ext</artifactId>
+      <scope>runtime</scope>
+    </dependency>
 
     <!-- SLF4J logging markers -->
     <dependency>
                 <patch patchfile="${project.basedir}/src/main/patches/karaf-quiesce.patch"
                        originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
                        failonerror="true"/>
+                <patch patchfile="${project.basedir}/src/main/patches/karaf-remove-bc.patch"
+                       originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
+                       failonerror="true"/>
                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
                          token="commons-io/commons-io/2.8.0" value="commons-io/commons-io/2.11.0" failOnNoReplacements="true"/>
                 <copy file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
 mvn\:org.osgi/org.osgi.service.event/1.4.0 = 7
 mvn\:org.apache.felix/org.apache.felix.metatype/1.2.4 = 8
 mvn\:org.opendaylight.odlparent/bcprov-framework-ext/${project.version} = 14
+mvn\:org.opendaylight.odlparent/bcutil-framework-ext/${project.version} = 14
 mvn\:org.opendaylight.odlparent/bcpkix-framework-ext/${project.version} = 14
 mvn\:org.opendaylight.odlparent/logging-markers/${project.version} = 14
 mvn\:org.apache.aries.blueprint/org.apache.aries.blueprint.core.compatibility/1.0.0 = 14
diff --git a/karaf/opendaylight-karaf-resources/src/main/patches/karaf-remove-bc.patch b/karaf/opendaylight-karaf-resources/src/main/patches/karaf-remove-bc.patch
new file mode 100644 (file)
index 0000000..7f71811
--- /dev/null
@@ -0,0 +1,19 @@
+--- system/org/apache/karaf/features/standard/4.3.2/standard-4.3.2-features.xml.orig   2021-08-23 13:17:26.231520995 +0200
++++ system/org/apache/karaf/features/standard/4.3.2/standard-4.3.2-features.xml        2021-08-23 13:20:50.730969216 +0200
+@@ -992,8 +993,6 @@
+         <bundle start-level="30">mvn:org.apache.sshd/sshd-osgi/2.5.1</bundle>
+         <bundle start-level="30">mvn:org.apache.sshd/sshd-scp/2.5.1</bundle>
+         <bundle start-level="30">mvn:org.apache.sshd/sshd-sftp/2.5.1</bundle>
+-        <bundle start-level="30">mvn:org.bouncycastle/bcprov-jdk15on/1.66</bundle>
+-        <bundle start-level="30">mvn:org.bouncycastle/bcpkix-jdk15on/1.66</bundle>
+         <bundle start-level="30">mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/4.3.2</bundle>
+     </feature>
+
+@@ -1443,7 +1442,6 @@
+
+     <feature name="spring-security-crypto-encryption" description="Advanced encryption support for Karaf security" version="4.3.2">
+         <feature>jaas</feature>
+-        <bundle dependency="true" start-level="30">mvn:org.bouncycastle/bcprov-jdk15on/1.66</bundle>
+         <bundle dependency="true" start-level="30">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-security-crypto/5.3.3.RELEASE_2</bundle>
+         <bundle start-level="30">mvn:org.apache.karaf.jaas/org.apache.karaf.jaas.spring-security-crypto/4.3.2</bundle>
+     </feature>
index fe0f2b4b143598927d8d26aecc920fe6a372b5bc..0634806c33541c81d740866caa133581319e1aeb 100644 (file)
@@ -28,6 +28,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <modules>
         <module>bcpkix-framework-ext</module>
         <module>bcprov-framework-ext</module>
+        <module>bcutil-framework-ext</module>
         <module>karaf-branding</module>
         <module>karaf-dist-static</module>
         <module>karaf4-parent</module>
index de9e6b146a13cb49197fe0d4f2bf3099baff180f..24750bc292b8e2adc90e1532b65666d1ea595adc 100644 (file)
                 <artifactId>bcprov-framework-ext</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.opendaylight.odlparent</groupId>
+                <artifactId>bcutil-framework-ext</artifactId>
+                <version>${project.version}</version>
+            </dependency>
 
             <dependency>
                 <groupId>org.opendaylight.odlparent</groupId>
index 94f4eca3853092041222c032f0b2221fc4ea8110..a75a312b2632f32f33ee14f9b742be52e115b71b 100644 (file)
             <groupId>org.bouncycastle</groupId>
             <artifactId>bcprov-jdk15on</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcutil-jdk15on</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.checkerframework</groupId>
             <artifactId>checker-qual</artifactId>
index 12d734c29a709f374630e16b3a8987d2c4f636fc..ff99edbd17695781e35fa06bec04e2ae150bc3aa 100644 (file)
         <artifactId>bcprov-ext-jdk15on</artifactId>
         <version>${bouncycastle.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.bouncycastle</groupId>
+        <artifactId>bcutil-jdk15on</artifactId>
+        <version>${bouncycastle.version}</version>
+      </dependency>
 
       <dependency>
         <groupId>com.webcohesion.enunciate</groupId>
index 10c590eb80a2126d018fb257e73f82486da93f2c..a7cc80fd0f8eb79fb295cfe6cb20e0564e748f4e 100644 (file)
@@ -81,6 +81,7 @@
                         <excludedArtifactId>bcprov-jdk15on</excludedArtifactId>
                         <excludedArtifactId>bcprov-ext-jdk15on</excludedArtifactId>
                         <excludedArtifactId>bcpkix-jdk15on</excludedArtifactId>
+                        <excludedArtifactId>bcutil-jdk15on</excludedArtifactId>
                         <!-- JAXB -->
                         <excludedArtifactId>jaxb-api</excludedArtifactId>
                         <excludedArtifactId>jaxb-runtime</excludedArtifactId>