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