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