1 <?xml version="1.0" encoding="UTF-8"?>
3 Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
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">
12 <groupId>org.opendaylight.odlparent</groupId>
13 <artifactId>odlparent</artifactId>
14 <version>1.9.1-SNAPSHOT</version>
15 <relativePath>../../odlparent</relativePath>
17 <modelVersion>4.0.0</modelVersion>
18 <artifactId>karaf-parent</artifactId>
19 <packaging>pom</packaging>
20 <name>ODL :: odlparent :: ${project.artifactId}</name>
23 <branding.version>1.9.1-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
30 <karaf.maven.version>3.0.1</karaf.maven.version>
31 <karaf.archiveTarGz>true</karaf.archiveTarGz>
32 <karaf.archiveZip>true</karaf.archiveZip>
34 <dependencyManagement>
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>
45 <groupId>org.osgi</groupId>
46 <artifactId>org.osgi.core</artifactId>
49 <groupId>org.apache.sshd</groupId>
50 <artifactId>sshd-core</artifactId>
52 <!-- We provide a newer version of Aries Proxy -->
54 <groupId>org.apache.aries.proxy</groupId>
55 <artifactId>org.apache.aries.proxy.impl</artifactId>
60 </dependencyManagement>
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
67 <groupId>org.apache.karaf.features</groupId>
68 <artifactId>standard</artifactId>
69 <version>${karaf.version}</version>
71 <classifier>features</classifier>
72 <scope>runtime</scope>
74 <!-- karaf region 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>
83 <groupId>org.opendaylight.odlparent</groupId>
84 <artifactId>karaf.branding</artifactId>
85 <version>${branding.version}</version>
86 <scope>compile</scope>
89 <!-- Resources needed -->
91 <groupId>org.opendaylight.odlparent</groupId>
92 <artifactId>opendaylight-karaf-resources</artifactId>
93 <version>1.9.1-SNAPSHOT</version>
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 -->
99 <groupId>org.apache.aries.proxy</groupId>
100 <artifactId>org.apache.aries.proxy.impl</artifactId>
101 <version>1.0.5</version>
108 <groupId>org.eclipse.m2e</groupId>
109 <artifactId>lifecycle-mapping</artifactId>
110 <version>1.0.0</version>
112 <lifecycleMappingMetadata>
115 <pluginExecutionFilter>
116 <groupId>org.apache.felix</groupId>
117 <artifactId>maven-bundle-plugin</artifactId>
118 <versionRange>[0,)</versionRange>
120 <goal>cleanVersions</goal>
122 </pluginExecutionFilter>
128 <pluginExecutionFilter>
129 <groupId>org.apache.maven.plugins</groupId>
130 <artifactId>maven-dependency-plugin</artifactId>
131 <versionRange>[0,)</versionRange>
136 </pluginExecutionFilter>
142 <pluginExecutionFilter>
143 <groupId>org.apache.karaf.tooling</groupId>
144 <artifactId>karaf-maven-plugin</artifactId>
145 <versionRange>[0,)</versionRange>
147 <goal>commands-generate-help</goal>
148 <goal>features-add-to-repository</goal>
149 <goal>install-kars</goal>
151 </pluginExecutionFilter>
157 <pluginExecutionFilter>
158 <groupId>org.fusesource.scalate</groupId>
159 <artifactId>maven-scalate-plugin</artifactId>
160 <versionRange>[0,)</versionRange>
164 </pluginExecutionFilter>
170 <pluginExecutionFilter>
171 <groupId>org.apache.servicemix.tooling</groupId>
172 <artifactId>depends-maven-plugin</artifactId>
173 <versionRange>[0,)</versionRange>
175 <goal>generate-depends-file</goal>
177 </pluginExecutionFilter>
183 </lifecycleMappingMetadata>
188 <artifactId>maven-resources-plugin</artifactId>
191 <id>copy-resources</id>
192 <!-- here the phase you need -->
193 <phase>prepare-package</phase>
195 <goal>copy-resources</goal>
198 <outputDirectory>${basedir}/target/assembly</outputDirectory>
201 <directory>src/main/assembly</directory>
204 <overwrite>true</overwrite>
210 <groupId>org.apache.karaf.tooling</groupId>
211 <artifactId>karaf-maven-plugin</artifactId>
212 <version>${karaf.maven.version}</version>
213 <extensions>true</extensions>
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
219 <feature>eventadmin</feature>
222 <feature>standard</feature>
223 <feature>${karaf.localFeature}</feature>
225 <!-- no installedFeatures -->
229 <id>populate-system</id>
230 <phase>generate-resources</phase>
232 <goal>features-add-to-repository</goal>
236 <descriptor>mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features</descriptor>
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>
247 <repository>target/assembly/system</repository>
251 <id>process-resources</id>
253 <goal>install-kars</goal>
255 <phase>process-resources</phase>
260 <goal>instance-create-archive</goal>
263 <archiveTarGz>${karaf.archiveTarGz}</archiveTarGz>
264 <archiveZip>${karaf.archiveZip}</archiveZip>
270 <groupId>org.apache.maven.plugins</groupId>
271 <artifactId>maven-checkstyle-plugin</artifactId>
272 <version>${checkstyle.version}</version>
274 <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/configuration\/initial\/</excludes>
278 <groupId>org.apache.maven.plugins</groupId>
279 <artifactId>maven-dependency-plugin</artifactId>
286 <!-- here the phase you need -->
287 <phase>generate-resources</phase>
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>
301 <id>unpack-karaf-resources</id>
303 <goal>unpack-dependencies</goal>
305 <phase>prepare-package</phase>
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>
316 <id>org.ops4j.pax.url.mvn.cfg</id>
320 <phase>prepare-package</phase>
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>
333 <overWriteReleases>true</overWriteReleases>
334 <overWriteSnapshots>true</overWriteSnapshots>
340 <groupId>org.apache.maven.plugins</groupId>
341 <artifactId>maven-antrun-plugin</artifactId>
344 <phase>prepare-package</phase>
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"/>
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"/>
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"/>
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"/>
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"/>
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"/>
387 <delete file="${project.build.directory}/assembly/lib/endorsed/org.apache.servicemix.bundles.xalan-2.7.2_3.jar" />
395 <groupId>org.opendaylight.odlparent</groupId>
396 <artifactId>karaf-plugin</artifactId>
397 <version>1.9.1-SNAPSHOT</version>
400 <id>populate-local-repo</id>
402 <goal>populate-local-repo</goal>
405 <localRepo>${project.build.directory}/assembly/system</localRepo>
414 <artifactId>maven-resources-plugin</artifactId>
417 <groupId>org.apache.karaf.tooling</groupId>
418 <artifactId>karaf-maven-plugin</artifactId>
421 <groupId>org.apache.maven.plugins</groupId>
422 <artifactId>maven-checkstyle-plugin</artifactId>
425 <groupId>org.apache.maven.plugins</groupId>
426 <artifactId>maven-dependency-plugin</artifactId>
429 <groupId>org.apache.maven.plugins</groupId>
430 <artifactId>maven-antrun-plugin</artifactId>
433 <groupId>org.opendaylight.odlparent</groupId>
434 <artifactId>karaf-plugin</artifactId>