copy the config.properties and edit it to allow reading of x509 classes master
authorAlex Heneveld <alex@cloudsoft.io>
Mon, 18 Jul 2022 16:09:35 +0000 (17:09 +0100)
committerAlex Heneveld <alex@cloudsoft.io>
Mon, 18 Jul 2022 16:09:35 +0000 (17:09 +0100)
karaf/features/pom.xml
karaf/features/src/main/filtered-resources/resources/etc/config.properties [new file with mode: 0644]

index 8224e1cfda807bd14241776fb21caeb15ab05244..615ba52bf32d128e0d6360d5c259e31c80f2c14d 100644 (file)
             <classifier>features</classifier>
             <type>xml</type>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.karaf.features</groupId>
+            <artifactId>framework</artifactId>
+            <version>${karaf.version}</version>
+            <type>kar</type>
+            <scope>runtime</scope>
+        </dependency>
     </dependencies>
 
 
               </executions>
             </plugin>
 
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>copy</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <artifactItems>
+                        <artifactItem>
+                            <groupId>org.apache.karaf.features</groupId>
+                            <artifactId>framework</artifactId>
+                            <version>${karaf.version}</version>
+                            <type>kar</type>
+                            <overWrite>true</overWrite>
+                            <outputDirectory>${project.basedir}/target/kars</outputDirectory>
+                        </artifactItem>
+                    </artifactItems>
+                    <useBaseVersion>true</useBaseVersion>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.8</version>
+                <executions>
+                    <execution>
+                        <phase>generate-resources</phase>
+                        <configuration>
+                            <exportAntProperties>true</exportAntProperties>
+                            <tasks>
+                                <echo message="Unpacking KARs to override" />
+                                <unzip src="${project.basedir}/target/kars/framework-${karaf.version}.kar" dest="${project.basedir}/target/kars-expanded/"/>
+
+                                <!-- then read the contents, so we can set those in the src/main/filtered-resources/ here
+                                     do replacements and remove license headers as needed -->
+
+                                <echo message="Exporting properties for contents of KAR resources to be included in this project's resources" />
+                                <loadfile property="kar.config.properties" srcFile="${project.basedir}/target/kars-expanded/resources/etc/config.properties">
+                                  <filterchain>
+                                    <tokenfilter>
+                                      <linetokenizer/>
+                                      <replaceregex pattern="sun\.misc,(.*)" replace="sun\.misc, sun.security.x509,\1"/>
+                                    </tokenfilter>
+                                  </filterchain>
+                                </loadfile>
+
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
         </plugins>
     </build>
 
diff --git a/karaf/features/src/main/filtered-resources/resources/etc/config.properties b/karaf/features/src/main/filtered-resources/resources/etc/config.properties
new file mode 100644 (file)
index 0000000..15c457a
--- /dev/null
@@ -0,0 +1 @@
+${kar.config.properties}