Suppress JaCoCo in opendaylight-karaf-resources
[odlparent.git] / karaf / opendaylight-karaf-resources / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
4
5  This program and the accompanying materials are made available under the
6  terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  and is available at http://www.eclipse.org/legal/epl-v10.html
8 -->
9 <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">
10   <modelVersion>4.0.0</modelVersion>
11   <parent>
12     <groupId>org.opendaylight.odlparent</groupId>
13     <artifactId>odlparent</artifactId>
14     <version>8.0.1-SNAPSHOT</version>
15     <relativePath>../../odlparent</relativePath>
16   </parent>
17   <artifactId>opendaylight-karaf-resources</artifactId>
18   <description>Resources for opendaylight-karaf</description>
19   <packaging>jar</packaging>
20   <name>ODL :: odlparent :: ${project.artifactId}</name>
21   <properties>
22     <!-- There are a lot of duplicate classes in the dependencies below, but this is not a real issue,
23          because this is not a real Java artifact; it's just packaging.  (TODO: Ideally, this artifact should
24          just have odlparent-lite not odlparent as parent, and not run Java static code analysis tools.)
25       -->
26     <duplicate-finder.skip>true</duplicate-finder.skip>
27     <!-- jacoco:report bombs out on BouncyCastle's JDK15 classes, it has not point anyway -->
28     <jacoco.skip>true</jacoco.skip>
29   </properties>
30   <dependencies>
31     <dependency>
32       <groupId>org.apache.karaf.features</groupId>
33       <artifactId>framework</artifactId>
34       <version>${karaf.version}</version>
35       <type>kar</type>
36     </dependency>
37     <dependency>
38       <groupId>org.apache.karaf.features</groupId>
39       <artifactId>standard</artifactId>
40       <version>${karaf.version}</version>
41       <classifier>features</classifier>
42       <type>xml</type>
43       <scope>runtime</scope>
44     </dependency>
45
46     <!-- BouncyCastle Framework Extension Bundles -->
47     <dependency>
48       <groupId>org.opendaylight.odlparent</groupId>
49       <artifactId>bcpkix-framework-ext</artifactId>
50       <scope>runtime</scope>
51     </dependency>
52     <dependency>
53       <groupId>org.opendaylight.odlparent</groupId>
54       <artifactId>bcprov-framework-ext</artifactId>
55       <scope>runtime</scope>
56     </dependency>
57
58     <!-- SLF4J logging markers -->
59     <dependency>
60       <groupId>org.opendaylight.odlparent</groupId>
61       <artifactId>logging-markers</artifactId>
62       <scope>runtime</scope>
63     </dependency>
64   </dependencies>
65
66   <build>
67     <resources>
68       <resource>
69         <directory>src/main/resources</directory>
70         <filtering>false</filtering>
71       </resource>
72     </resources>
73     <plugins>
74       <plugin>
75         <artifactId>maven-antrun-plugin</artifactId>
76         <executions>
77           <execution>
78             <id>patch-karaf-scripts</id>
79             <phase>prepare-package</phase>
80             <goals>
81               <goal>run</goal>
82             </goals>
83             <configuration>
84               <target>
85                 <!-- Patches only work with LF line endings from ant -->
86                 <fixcrlf srcdir="${project.build.directory}/assembly/bin"
87                          includes="*.bat" eol="lf"/>
88                 <patch patchfile="${project.basedir}/src/main/patches/karaf-instance.patch"
89                        originalfile="${project.build.directory}/assembly/bin/instance"
90                        failonerror="true"/>
91                 <copy file="${project.build.directory}/assembly/bin/instance"
92                       tofile="${project.build.directory}/classes/bin/instance"/>
93                 <patch patchfile="${project.basedir}/src/main/patches/karaf-instance.bat.patch"
94                        originalfile="${project.build.directory}/assembly/bin/instance.bat"
95                        failonerror="true" ignorewhitespace="true"/>
96                 <copy file="${project.build.directory}/assembly/bin/instance.bat"
97                       tofile="${project.build.directory}/classes/bin/instance.bat"/>
98                 <patch patchfile="${project.basedir}/src/main/patches/karaf-inc.patch"
99                        originalfile="${project.build.directory}/assembly/bin/inc"
100                        failonerror="true"/>
101                 <copy file="${project.build.directory}/assembly/bin/inc"
102                       tofile="${project.build.directory}/classes/bin/inc"/>
103                 <patch patchfile="${project.basedir}/src/main/patches/karaf-karaf.patch"
104                        originalfile="${project.build.directory}/assembly/bin/karaf"
105                        failonerror="true"/>
106                 <copy file="${project.build.directory}/assembly/bin/karaf"
107                       tofile="${project.build.directory}/classes/bin/karaf"/>
108                 <patch patchfile="${project.basedir}/src/main/patches/karaf-karaf.bat.patch"
109                        originalfile="${project.build.directory}/assembly/bin/karaf.bat"
110                        failonerror="true"/>
111                 <copy file="${project.build.directory}/assembly/bin/karaf.bat"
112                       tofile="${project.build.directory}/classes/bin/karaf.bat"/>
113                 <patch patchfile="${project.basedir}/src/main/patches/karaf-setenv.patch"
114                        originalfile="${project.build.directory}/assembly/bin/setenv"
115                        failonerror="true"/>
116                 <copy file="${project.build.directory}/assembly/bin/setenv"
117                       tofile="${project.build.directory}/classes/bin/setenv"/>
118                 <patch patchfile="${project.basedir}/src/main/patches/karaf-setenv.bat.patch"
119                        originalfile="${project.build.directory}/assembly/bin/setenv.bat"
120                        failonerror="true"/>
121                 <copy file="${project.build.directory}/assembly/bin/setenv.bat"
122                       tofile="${project.build.directory}/classes/bin/setenv.bat"/>
123                 <patch patchfile="${project.basedir}/src/main/patches/karaf-quiesce.patch"
124                        originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
125                        failonerror="true"/>
126                 <copy file="${project.build.directory}/assembly/system/org/apache/karaf/features/framework/${karaf.version}/framework-${karaf.version}-features.xml"
127                       tofile="${project.build.directory}/classes/system/org/apache/karaf/features/framework/${karaf.version}/framework-${karaf.version}-features.xml"/>
128                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
129                          token="commons-io/commons-io/2.6" value="commons-io/commons-io/2.8.0" failOnNoReplacements="true"/>
130                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
131                          token="commons-codec/commons-codec/1.14" value="commons-codec/commons-codec/1.15" failOnNoReplacements="true"/>
132                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
133                          token="org.apache.commons/commons-lang3/3.10" value="org.apache.commons/commons-lang3/3.11" failOnNoReplacements="true"/>
134                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
135                          token="org.apache.felix.scr/2.1.20" value="org.apache.felix.scr/2.1.24" failOnNoReplacements="true"/>
136                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
137                          token="javax.annotation/javax.annotation-api/1.3&lt;" value="javax.annotation/javax.annotation-api/1.3.1&lt;" failOnNoReplacements="true"/>
138                 <copy file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
139                       tofile="${project.build.directory}/classes/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"/>
140                 <replace file="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/7.2.16/pax-web-features-7.2.16-features.xml"
141                          token="commons-codec/commons-codec/1.11" value="commons-codec/commons-codec/1.15" failOnNoReplacements="true"/>
142                 <replace file="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/7.2.16/pax-web-features-7.2.16-features.xml"
143                          token="javax.annotation/javax.annotation-api/1.3&lt;" value="javax.annotation/javax.annotation-api/1.3.1&lt;" failOnNoReplacements="true"/>
144                 <copy file="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/7.2.16/pax-web-features-7.2.16-features.xml"
145                       tofile="${project.build.directory}/classes/system/org/ops4j/pax/web/pax-web-features/7.2.16/pax-web-features-7.2.16-features.xml"/>
146                 <!-- Add startup bundles to startup.properties — order is significant, bundles are wired in declaration order -->
147                 <echo file="${project.build.directory}/assembly/etc/startup.properties" append="true">
148 # The following are added by opendaylight-karaf-resources
149 mvn\:org.osgi/org.osgi.service.event/1.3.1 = 7
150 mvn\:org.apache.felix/org.apache.felix.metatype/1.2.2 = 8
151 mvn\:org.opendaylight.odlparent/bcprov-framework-ext/${project.version} = 14
152 mvn\:org.opendaylight.odlparent/bcpkix-framework-ext/${project.version} = 14
153 mvn\:org.opendaylight.odlparent/logging-markers/${project.version} = 14
154 mvn\:org.apache.aries.blueprint/org.apache.aries.blueprint.core.compatibility/1.0.0 = 14
155                 </echo>
156                 <copy file="${project.build.directory}/assembly/etc/startup.properties"
157                       tofile="${project.build.directory}/classes/etc/startup.properties"/>
158                 <fixcrlf srcdir="${project.build.directory}/classes/bin"
159                          includes="*.bat" eol="crlf"/>
160               </target>
161             </configuration>
162           </execution>
163         </executions>
164       </plugin>
165       <plugin>
166         <groupId>org.apache.maven.plugins</groupId>
167         <artifactId>maven-dependency-plugin</artifactId>
168         <executions>
169           <execution>
170             <id>copy-framework-extensions</id>
171             <goals>
172               <goal>copy</goal>
173             </goals>
174             <phase>generate-resources</phase>
175             <configuration>
176               <artifactItems>
177                 <!-- Needs to be copied to lib/boot in order have it accessible to Main class -->
178                 <artifactItem>
179                     <groupId>org.bouncycastle</groupId>
180                     <artifactId>bcprov-ext-jdk15on</artifactId>
181                     <version>${bouncycastle.version}</version>
182                     <outputDirectory>target/classes/lib/boot</outputDirectory>
183                     <destFileName>bcprov-ext-jdk15on-${bouncycastle.version}.jar</destFileName>
184                 </artifactItem>
185                 <artifactItem>
186                     <groupId>org.bouncycastle</groupId>
187                     <artifactId>bcpkix-jdk15on</artifactId>
188                     <version>${bouncycastle.version}</version>
189                     <outputDirectory>target/classes/lib/boot</outputDirectory>
190                     <destFileName>bcpkix-jdk15on-${bouncycastle.version}.jar</destFileName>
191                 </artifactItem>
192               </artifactItems>
193               <silent>true</silent>
194             </configuration>
195           </execution>
196         </executions>
197       </plugin>
198       <plugin>
199         <groupId>org.codehaus.mojo</groupId>
200         <artifactId>build-helper-maven-plugin</artifactId>
201         <executions>
202           <execution>
203             <id>attach-artifacts</id>
204             <goals>
205               <goal>attach-artifact</goal>
206             </goals>
207             <phase>package</phase>
208             <configuration>
209               <artifacts>
210                 <artifact>
211                   <file>src/main/assembly/etc/org.ops4j.pax.url.mvn.cfg</file>
212                   <type>properties</type>
213                   <classifier>config</classifier>
214                 </artifact>
215               </artifacts>
216             </configuration>
217           </execution>
218         </executions>
219       </plugin>
220       <plugin>
221         <!-- We do this here only so that we can patch a few files,
222              but we then "throw away" (do not package) most of it,
223              as the karaf4-parent will do this again                -->
224         <groupId>org.apache.karaf.tooling</groupId>
225         <artifactId>karaf-maven-plugin</artifactId>
226         <version>${karaf.version}</version>
227         <executions>
228           <execution>
229             <id>process-resources</id>
230             <phase>process-resources</phase>
231             <goals>
232               <goal>assembly</goal>
233             </goals>
234           </execution>
235       </executions>
236       </plugin>
237       <!-- This needs to execute before patching, otherwise the feature will be left unpatched -->
238       <plugin>
239         <groupId>org.opendaylight.odlparent</groupId>
240         <artifactId>karaf-plugin</artifactId>
241         <version>8.0.1-SNAPSHOT</version>
242         <executions>
243           <execution>
244             <id>populate-local-repo</id>
245             <phase>prepare-package</phase>
246             <goals>
247               <goal>populate-local-repo</goal>
248             </goals>
249             <configuration>
250               <localRepo>${project.build.directory}/assembly/system</localRepo>
251             </configuration>
252           </execution>
253         </executions>
254       </plugin>
255     </plugins>
256   </build>
257 </project>