Fix BouncyCastle packaging
[odlparent.git] / karaf / karaf4-parent / pom.xml
index 783ee00845995cd752e99d666f081c0f381be949..10b4fb1324500c77ba13e68e365e9b174e2f56f9 100644 (file)
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent</artifactId>
-        <version>2.0.0-SNAPSHOT</version>
+        <version>9.0.4-SNAPSHOT</version>
         <relativePath>../../odlparent</relativePath>
     </parent>
 
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>karaf4-parent</artifactId>
-    <version>2.0.0-SNAPSHOT</version>
+    <version>9.0.4-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>ODL :: odlparent :: ${project.artifactId}</name>
 
     <properties>
         <!-- Projects can override this to add their own boot feature -->
         <karaf.localFeature>standard</karaf.localFeature>
+        <karaf.archiveZip>true</karaf.archiveZip>
+        <karaf.archiveTarGz>true</karaf.archiveTarGz>
     </properties>
 
     <dependencyManagement>
             <artifactId>org.osgi.service.event</artifactId>
         </dependency>
 
+        <!-- Optional dependency of karaf.config.core -->
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.metatype</artifactId>
+        </dependency>
+
         <!-- ODL Branding -->
         <dependency>
             <groupId>org.opendaylight.odlparent</groupId>
             <groupId>org.opendaylight.odlparent</groupId>
             <artifactId>opendaylight-karaf-resources</artifactId>
         </dependency>
+
+        <!-- BouncyCastle Framework Extension Bundles -->
+        <dependency>
+            <groupId>org.opendaylight.odlparent</groupId>
+            <artifactId>bcpkix-framework-ext</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.odlparent</groupId>
+            <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>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.opendaylight.odlparent</groupId>
+                    <artifactId>karaf-plugin</artifactId>
+                    <version>9.0.4-SNAPSHOT</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+
         <plugins>
-            <plugin>
-                <artifactId>maven-resources-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>process-resources</id>
-                        <goals>
-                            <goal>resources</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
                 <artifactId>maven-remote-resources-plugin</artifactId>
                 <configuration>
                 <artifactId>maven-dependency-plugin</artifactId>
                 <executions>
                     <execution>
-                        <id>copy</id>
+                        <id>apply-branding</id>
                         <goals>
                             <goal>copy</goal>
                         </goals>
                                 <artifactItem>
                                     <groupId>org.opendaylight.odlparent</groupId>
                                     <artifactId>karaf.branding</artifactId>
-                                    <version>2.0.0-SNAPSHOT</version>
+                                    <version>9.0.4-SNAPSHOT</version>
                                     <outputDirectory>target/assembly/lib</outputDirectory>
-                                    <destFileName>karaf.branding-2.0.0-SNAPSHOT.jar</destFileName>
+                                    <destFileName>karaf.branding-9.0.4-SNAPSHOT.jar</destFileName>
                                 </artifactItem>
                             </artifactItems>
+                            <silent>true</silent>
                         </configuration>
                     </execution>
                     <execution>
                             <excludes>META-INF\/**</excludes>
                             <excludeTransitive>true</excludeTransitive>
                             <ignorePermissions>false</ignorePermissions>
+                            <silent>true</silent>
                         </configuration>
                     </execution>
                     <execution>
                     </execution>
                 </executions>
             </plugin>
-
-            <!-- This needs to execute before patching, otherwise the feature will be left unpatched -->
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/assembly</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/assembly</directory>
+                                </resource>
+                            </resources>
+                            <overwrite>true</overwrite>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>process-resources</id>
+                        <goals>
+                            <goal>resources</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <groupId>org.opendaylight.odlparent</groupId>
                 <artifactId>karaf-plugin</artifactId>
-                <version>2.0.0-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <id>populate-local-repo</id>
+                        <phase>prepare-package</phase>
                         <goals>
                             <goal>populate-local-repo</goal>
                         </goals>
                 <artifactId>maven-antrun-plugin</artifactId>
                 <executions>
                     <execution>
-                        <id>patch-karaf-scripts</id>
+                        <id>fix-permissions</id>
                         <phase>prepare-package</phase>
                         <goals>
                             <goal>run</goal>
                         </goals>
                         <configuration>
                             <target>
-                                <!-- Patches only work with LF line endings from ant -->
-                                <fixcrlf srcdir="${project.build.directory}/assembly/bin"
-                                         includes="*.bat" eol="lf"/>
-                                <patch patchfile="${project.build.directory}/assembly/patches/karaf-instance.patch"
-                                       originalfile="${project.build.directory}/assembly/bin/instance"
-                                       failonerror="true"/>
-                                <patch patchfile="${project.build.directory}/assembly/patches/karaf-instance.bat.patch"
-                                       originalfile="${project.build.directory}/assembly/bin/instance.bat"
-                                       failonerror="true" ignorewhitespace="true"/>
-                                <patch patchfile="${project.build.directory}/assembly/patches/karaf-karaf-${karaf.version}.patch"
-                                       originalfile="${project.build.directory}/assembly/bin/karaf"
-                                       failonerror="true"/>
-                                <patch patchfile="${project.build.directory}/assembly/patches/karaf-karaf.bat.patch"
-                                       originalfile="${project.build.directory}/assembly/bin/karaf.bat"
-                                       failonerror="true"/>
-                                <patch patchfile="${project.build.directory}/assembly/patches/karaf-setenv-${karaf.version}.patch"
-                                       originalfile="${project.build.directory}/assembly/bin/setenv"
-                                       failonerror="true"/>
-                                <patch patchfile="${project.build.directory}/assembly/patches/karaf-setenv.bat.patch"
-                                       originalfile="${project.build.directory}/assembly/bin/setenv.bat"
-                                       failonerror="true"/>
-                                <patch patchfile="${project.build.directory}/assembly/patches/karaf-quiesce-${karaf.version}.patch"
-                                       originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
-                                       failonerror="true"/>
-                                <patch patchfile="${project.build.directory}/assembly/patches/karaf-javax-mail-${karaf.version}.patch"
-                                       originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
-                                       failonerror="true"/>
-                                <patch patchfile="${project.build.directory}/assembly/patches/karaf-paxweb.patch"
-                                       originalfile="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/4.3.0/pax-web-features-4.3.0-features.xml"
-                                       failonerror="true"/>
-                                <patch patchfile="${project.build.directory}/assembly/patches/karaf-etc-startup-properties-4.0.9.patch"
-                                       originalfile="${project.build.directory}/assembly/etc/startup.properties"
-                                       failonerror="true"/>
-                                <fixcrlf srcdir="${project.build.directory}/assembly/bin"
-                                         includes="*.bat" eol="crlf"/>
-                                <echo file="${project.build.directory}/assembly/etc/system.properties" append="true">mvn\:org.osgi/org.osgi.service.event/1.3.1 = 8</echo>
+                                <chmod perm="755">
+                                    <fileset dir="${project.build.directory}/assembly/bin">
+                                        <!-- Ensure that all the shell scripts are executable -->
+                                        <exclude name="*.bat"/>
+                                        <exclude name="contrib/*"/>
+                                    </fileset>
+                                </chmod>
+                            </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>
             <plugin>
                 <groupId>org.apache.karaf.tooling</groupId>
                 <artifactId>karaf-maven-plugin</artifactId>
-                <version>${karaf.plugin.version}</version>
+                <version>${karaf.version}</version>
                 <executions>
                     <execution>
                         <id>process-resources</id>
                     </installedFeatures>
                     <bootFeatures>
                         <feature>standard</feature>
-                        <!-- We load wrap as a workaround to handle old features without the wrap prerequisite -->
-                        <!-- TODO Remove this once all the downstream features are fixed -->
-                        <feature>wrap</feature>
+                        <!-- Features always assumed to be present. Keep in sync with feature parent exclusions. -->
+                        <feature>ssh</feature>
+                        <feature>scr</feature>
                         <!-- Local feature if any -->
                         <feature>${karaf.localFeature}</feature>
                     </bootFeatures>
-                    <javase>1.8</javase>
+                    <javase>${maven.compiler.release}</javase>
+                    <archiveTarGz>${karaf.archiveTarGz}</archiveTarGz>
+                    <archiveZip>${karaf.archiveZip}</archiveZip>
                 </configuration>
             </plugin>
         </plugins>
     </build>
-
 </project>