1b1fada22ca89daeb246f20ab7a3b199359ebf31
[odlparent.git] / karaf / karaf-parent / 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"
10   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
11   <parent>
12     <groupId>org.opendaylight.odlparent</groupId>
13     <artifactId>odlparent</artifactId>
14     <version>1.8.2-SNAPSHOT</version>
15     <relativePath>../../odlparent</relativePath>
16   </parent>
17   <modelVersion>4.0.0</modelVersion>
18   <artifactId>karaf-parent</artifactId>
19   <packaging>pom</packaging>
20   <name>ODL :: odlparent :: ${project.artifactId}</name>
21
22   <properties>
23     <branding.version>1.8.2-SNAPSHOT</branding.version>
24     <karaf.localFeature>standard</karaf.localFeature>
25     <!--  Karaf Maven plugin 3.0.3 reinstalls already installed
26           boot features to container, which could be observed
27           in huge logs and seems like loop in build, even if it
28           is not.
29      -->
30     <karaf.maven.version>3.0.1</karaf.maven.version>
31     <karaf.archiveTarGz>true</karaf.archiveTarGz>
32     <karaf.archiveZip>true</karaf.archiveZip>
33   </properties>
34   <dependencyManagement>
35     <dependencies>
36       <dependency>
37         <!-- scope is compile so all features (there is only one) are installed
38         into startup.properties and the feature repo itself is not installed -->
39         <groupId>org.apache.karaf.features</groupId>
40         <artifactId>framework</artifactId>
41         <version>${karaf.version}</version>
42         <type>kar</type>
43         <exclusions>
44           <exclusion>
45             <groupId>org.osgi</groupId>
46             <artifactId>org.osgi.core</artifactId>
47           </exclusion>
48           <exclusion>
49             <groupId>org.apache.sshd</groupId>
50             <artifactId>sshd-core</artifactId>
51           </exclusion>
52           <!-- We provide a newer version of Aries Proxy -->
53           <exclusion>
54             <groupId>org.apache.aries.proxy</groupId>
55             <artifactId>org.apache.aries.proxy.impl</artifactId>
56           </exclusion>
57         </exclusions>
58       </dependency>
59     </dependencies>
60   </dependencyManagement>
61   <dependencies>
62     <!-- karaf standard features - scope is runtime so the feature repo is listed in the
63          features cfg file but the features aren't all installed by default via the
64          startup.properties. The features may be installed using the karaf-maven-plugin
65          configuration. -->
66     <dependency>
67       <groupId>org.apache.karaf.features</groupId>
68       <artifactId>standard</artifactId>
69       <version>${karaf.version}</version>
70       <type>xml</type>
71       <classifier>features</classifier>
72       <scope>runtime</scope>
73     </dependency>
74     <!-- karaf region dependency -->
75     <dependency>
76       <groupId>org.apache.karaf.region</groupId>
77       <artifactId>org.apache.karaf.region.persist</artifactId>
78       <version>${karaf.version}</version>
79       <scope>runtime</scope>
80     </dependency>
81     <!-- ODL Branding -->
82     <dependency>
83       <groupId>org.opendaylight.odlparent</groupId>
84       <artifactId>karaf.branding</artifactId>
85       <version>${branding.version}</version>
86       <scope>compile</scope>
87     </dependency>
88
89     <!-- Resources needed -->
90     <dependency>
91       <groupId>org.opendaylight.odlparent</groupId>
92       <artifactId>opendaylight-karaf-resources</artifactId>
93       <version>1.8.2-SNAPSHOT</version>
94     </dependency>
95
96     <!-- Aries Proxy 1.0.5 contains important bug fixes -->
97     <!-- Once we upgrade to a version of Karaf which has at least 1.0.5, this can be removed -->
98     <dependency>
99       <groupId>org.apache.aries.proxy</groupId>
100       <artifactId>org.apache.aries.proxy.impl</artifactId>
101       <version>1.0.5</version>
102     </dependency>
103   </dependencies>
104   <build>
105     <pluginManagement>
106       <plugins>
107         <plugin>
108           <groupId>org.eclipse.m2e</groupId>
109           <artifactId>lifecycle-mapping</artifactId>
110           <version>1.0.0</version>
111           <configuration>
112             <lifecycleMappingMetadata>
113               <pluginExecutions>
114                 <pluginExecution>
115                   <pluginExecutionFilter>
116                     <groupId>org.apache.felix</groupId>
117                     <artifactId>maven-bundle-plugin</artifactId>
118                     <versionRange>[0,)</versionRange>
119                     <goals>
120                       <goal>cleanVersions</goal>
121                     </goals>
122                   </pluginExecutionFilter>
123                   <action>
124                     <ignore></ignore>
125                   </action>
126                 </pluginExecution>
127                 <pluginExecution>
128                   <pluginExecutionFilter>
129                     <groupId>org.apache.maven.plugins</groupId>
130                     <artifactId>maven-dependency-plugin</artifactId>
131                     <versionRange>[0,)</versionRange>
132                     <goals>
133                       <goal>copy</goal>
134                       <goal>unpack</goal>
135                     </goals>
136                   </pluginExecutionFilter>
137                   <action>
138                     <ignore></ignore>
139                   </action>
140                 </pluginExecution>
141                 <pluginExecution>
142                   <pluginExecutionFilter>
143                     <groupId>org.apache.karaf.tooling</groupId>
144                     <artifactId>karaf-maven-plugin</artifactId>
145                     <versionRange>[0,)</versionRange>
146                     <goals>
147                       <goal>commands-generate-help</goal>
148                       <goal>features-add-to-repository</goal>
149                       <goal>install-kars</goal>
150                     </goals>
151                   </pluginExecutionFilter>
152                   <action>
153                     <ignore></ignore>
154                   </action>
155                 </pluginExecution>
156                 <pluginExecution>
157                   <pluginExecutionFilter>
158                     <groupId>org.fusesource.scalate</groupId>
159                     <artifactId>maven-scalate-plugin</artifactId>
160                     <versionRange>[0,)</versionRange>
161                     <goals>
162                       <goal>sitegen</goal>
163                     </goals>
164                   </pluginExecutionFilter>
165                   <action>
166                     <ignore></ignore>
167                   </action>
168                 </pluginExecution>
169                 <pluginExecution>
170                   <pluginExecutionFilter>
171                     <groupId>org.apache.servicemix.tooling</groupId>
172                     <artifactId>depends-maven-plugin</artifactId>
173                     <versionRange>[0,)</versionRange>
174                     <goals>
175                       <goal>generate-depends-file</goal>
176                     </goals>
177                   </pluginExecutionFilter>
178                   <action>
179                     <ignore></ignore>
180                   </action>
181                 </pluginExecution>
182               </pluginExecutions>
183             </lifecycleMappingMetadata>
184           </configuration>
185         </plugin>
186
187         <plugin>
188           <artifactId>maven-resources-plugin</artifactId>
189           <executions>
190             <execution>
191               <id>copy-resources</id>
192               <!-- here the phase you need -->
193               <phase>prepare-package</phase>
194               <goals>
195                 <goal>copy-resources</goal>
196               </goals>
197               <configuration>
198                 <outputDirectory>${basedir}/target/assembly</outputDirectory>
199                 <resources>
200                   <resource>
201                     <directory>src/main/assembly</directory>
202                   </resource>
203                 </resources>
204                 <overwrite>true</overwrite>
205               </configuration>
206             </execution>
207           </executions>
208         </plugin>
209         <plugin>
210           <groupId>org.apache.karaf.tooling</groupId>
211           <artifactId>karaf-maven-plugin</artifactId>
212           <version>${karaf.maven.version}</version>
213           <extensions>true</extensions>
214           <configuration>
215             <startupFeatures>
216               <!-- For some reason, the eventadmin bundle works fine when installed via the
217                    startup.properties but doesn't work properly when installed via the
218                    boot features.  -->
219               <feature>eventadmin</feature>
220             </startupFeatures>
221             <bootFeatures>
222               <feature>standard</feature>
223               <feature>${karaf.localFeature}</feature>
224             </bootFeatures>
225             <!-- no installedFeatures -->
226           </configuration>
227           <executions>
228             <execution>
229               <id>populate-system</id>
230               <phase>generate-resources</phase>
231               <goals>
232                 <goal>features-add-to-repository</goal>
233               </goals>
234               <configuration>
235                 <descriptors>
236                   <descriptor>mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features</descriptor>
237                 </descriptors>
238                 <features>
239                   <feature>standard</feature>
240                   <feature>config</feature>
241                   <feature>package</feature>
242                   <feature>kar</feature>
243                   <feature>ssh</feature>
244                   <feature>management</feature>
245                   <feature>war</feature>
246                 </features>
247                 <repository>target/assembly/system</repository>
248               </configuration>
249             </execution>
250             <execution>
251               <id>process-resources</id>
252               <goals>
253                 <goal>install-kars</goal>
254               </goals>
255               <phase>process-resources</phase>
256             </execution>
257             <execution>
258               <id>package</id>
259               <goals>
260                 <goal>instance-create-archive</goal>
261               </goals>
262               <configuration>
263                 <archiveTarGz>${karaf.archiveTarGz}</archiveTarGz>
264                 <archiveZip>${karaf.archiveZip}</archiveZip>
265               </configuration>
266             </execution>
267           </executions>
268         </plugin>
269         <plugin>
270           <groupId>org.apache.maven.plugins</groupId>
271           <artifactId>maven-checkstyle-plugin</artifactId>
272           <version>${checkstyle.version}</version>
273           <configuration>
274             <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/configuration\/initial\/</excludes>
275           </configuration>
276         </plugin>
277         <plugin>
278           <groupId>org.apache.maven.plugins</groupId>
279           <artifactId>maven-dependency-plugin</artifactId>
280           <executions>
281             <execution>
282               <id>copy</id>
283               <goals>
284                 <goal>copy</goal>
285               </goals>
286               <!-- here the phase you need -->
287               <phase>generate-resources</phase>
288               <configuration>
289                 <artifactItems>
290                   <artifactItem>
291                     <groupId>org.opendaylight.odlparent</groupId>
292                     <artifactId>karaf.branding</artifactId>
293                     <version>${karaf.branding.version}</version>
294                     <outputDirectory>target/assembly/lib</outputDirectory>
295                     <destFileName>karaf.branding-${branding.version}.jar</destFileName>
296                   </artifactItem>
297                 </artifactItems>
298               </configuration>
299             </execution>
300             <execution>
301               <id>unpack-karaf-resources</id>
302               <goals>
303                 <goal>unpack-dependencies</goal>
304               </goals>
305               <phase>prepare-package</phase>
306               <configuration>
307                 <outputDirectory>${project.build.directory}/assembly</outputDirectory>
308                 <groupId>org.opendaylight.odlparent</groupId>
309                 <includeArtifactIds>opendaylight-karaf-resources</includeArtifactIds>
310                 <excludes>META-INF\/**</excludes>
311                 <excludeTransitive>true</excludeTransitive>
312                 <ignorePermissions>false</ignorePermissions>
313               </configuration>
314             </execution>
315             <execution>
316               <id>org.ops4j.pax.url.mvn.cfg</id>
317               <goals>
318                 <goal>copy</goal>
319               </goals>
320               <phase>prepare-package</phase>
321               <configuration>
322                 <artifactItems>
323                   <artifactItem>
324                     <groupId>org.opendaylight.odlparent</groupId>
325                     <artifactId>opendaylight-karaf-resources</artifactId>
326                     <type>properties</type>
327                     <classifier>config</classifier>
328                     <overWrite>true</overWrite>
329                     <outputDirectory>${project.build.directory}/assembly/etc/</outputDirectory>
330                     <destFileName>org.ops4j.pax.url.mvn.cfg</destFileName>
331                   </artifactItem>
332                 </artifactItems>
333                 <overWriteReleases>true</overWriteReleases>
334                 <overWriteSnapshots>true</overWriteSnapshots>
335               </configuration>
336             </execution>
337           </executions>
338         </plugin>
339         <plugin>
340           <groupId>org.apache.maven.plugins</groupId>
341           <artifactId>maven-antrun-plugin</artifactId>
342           <executions>
343             <execution>
344               <phase>prepare-package</phase>
345               <goals>
346                 <goal>run</goal>
347               </goals>
348               <configuration>
349                 <target>
350                   <chmod perm="755">
351                     <fileset dir="${project.build.directory}/assembly/bin">
352                       <include name="karaf"/>
353                       <include name="instance"/>
354                       <include name="start"/>
355                       <include name="stop"/>
356                       <include name="status"/>
357                       <include name="client"/>
358                       <include name="shell"/>
359                     </fileset>
360                   </chmod>
361                   <!-- Remove this once Karaf provides a new-enough version of Aries Proxy -->
362                   <replace dir="${project.build.directory}/assembly/etc" token="org.apache.aries.proxy.impl/1.0.4"
363                            value="org.apache.aries.proxy.impl/1.0.5">
364                     <include name="startup.properties"/>
365                   </replace>
366
367                   <!-- BUG-5917, BUG-5943: remove overrides for platform factories and neuter Xalan's services-->
368                   <replace dir="${project.build.directory}/assembly/etc" token="javax.xml.parsers.DocumentBuilderFactory="
369                            value="# BUG-5943: javax.xml.parsers.DocumentBuilderFactory=">
370                     <include name="system.properties"/>
371                   </replace>
372                   <replace dir="${project.build.directory}/assembly/etc" token="javax.xml.transform.TransformerFactory="
373                            value="# BUG-5917: javax.xml.transform.TransformerFactory=">
374                     <include name="system.properties"/>
375                   </replace>
376                   <!-- Karaf 3.0.6 ships the Xalan 2.7.2_2 ServiceMix bundle -->
377                   <jar destfile="${project.build.directory}/assembly/lib/endorsed/odl-org.apache.servicemix.bundles.xalan-2.7.2_2_odl.jar">
378                     <zipfileset src="${project.build.directory}/assembly/lib/endorsed/org.apache.servicemix.bundles.xalan-2.7.2_2.jar"
379                                 excludes="META-INF/services/javax.xml.*" erroronmissingarchive="false"/>
380                   </jar>
381                   <delete file="${project.build.directory}/assembly/lib/endorsed/org.apache.servicemix.bundles.xalan-2.7.2_2.jar" />
382                   <!-- Karaf 3.0.7 ships the Xalan 2.7.2_3 ServiceMix bundle -->
383                   <jar destfile="${project.build.directory}/assembly/lib/endorsed/odl-org.apache.servicemix.bundles.xalan-2.7.2_3_odl.jar">
384                     <zipfileset src="${project.build.directory}/assembly/lib/endorsed/org.apache.servicemix.bundles.xalan-2.7.2_3.jar"
385                                 excludes="META-INF/services/javax.xml.*" erroronmissingarchive="false"/>
386                   </jar>
387                   <delete file="${project.build.directory}/assembly/lib/endorsed/org.apache.servicemix.bundles.xalan-2.7.2_3.jar" />
388
389                 </target>
390               </configuration>
391             </execution>
392           </executions>
393         </plugin>
394         <plugin>
395             <groupId>org.opendaylight.odlparent</groupId>
396             <artifactId>karaf-plugin</artifactId>
397             <version>1.8.2-SNAPSHOT</version>
398             <executions>
399                 <execution>
400                     <id>populate-local-repo</id>
401                     <goals>
402                         <goal>populate-local-repo</goal>
403                     </goals>
404                     <configuration>
405                         <localRepo>${project.build.directory}/assembly/system</localRepo>
406                     </configuration>
407                 </execution>
408             </executions>
409         </plugin>
410       </plugins>
411     </pluginManagement>
412     <plugins>
413       <plugin>
414         <artifactId>maven-resources-plugin</artifactId>
415       </plugin>
416       <plugin>
417         <groupId>org.apache.karaf.tooling</groupId>
418         <artifactId>karaf-maven-plugin</artifactId>
419       </plugin>
420       <plugin>
421         <groupId>org.apache.maven.plugins</groupId>
422         <artifactId>maven-checkstyle-plugin</artifactId>
423       </plugin>
424       <plugin>
425         <groupId>org.apache.maven.plugins</groupId>
426         <artifactId>maven-dependency-plugin</artifactId>
427       </plugin>
428       <plugin>
429         <groupId>org.apache.maven.plugins</groupId>
430         <artifactId>maven-antrun-plugin</artifactId>
431       </plugin>
432       <plugin>
433         <groupId>org.opendaylight.odlparent</groupId>
434         <artifactId>karaf-plugin</artifactId>
435       </plugin>
436     </plugins>
437   </build>
438
439 </project>