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.7.0-SNAPSHOT</version>
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>
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
32 <karaf.maven.version>3.0.1</karaf.maven.version>
33 <karaf.archiveTarGz>true</karaf.archiveTarGz>
34 <karaf.archiveZip>true</karaf.archiveZip>
36 <dependencyManagement>
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>
47 <groupId>org.osgi</groupId>
48 <artifactId>org.osgi.core</artifactId>
51 <groupId>org.apache.sshd</groupId>
52 <artifactId>sshd-core</artifactId>
54 <!-- We provide a newer version of Aries Proxy -->
56 <groupId>org.apache.aries.proxy</groupId>
57 <artifactId>org.apache.aries.proxy.impl</artifactId>
62 </dependencyManagement>
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
69 <groupId>org.apache.karaf.features</groupId>
70 <artifactId>standard</artifactId>
71 <version>${karaf.version}</version>
73 <classifier>features</classifier>
74 <scope>runtime</scope>
76 <!-- karaf region 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>
85 <groupId>org.opendaylight.controller</groupId>
86 <artifactId>karaf.branding</artifactId>
87 <version>${branding.version}</version>
88 <scope>compile</scope>
91 <!-- Resources needed -->
93 <groupId>org.opendaylight.controller</groupId>
94 <artifactId>opendaylight-karaf-resources</artifactId>
95 <version>${karaf.resources.version}</version>
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 -->
101 <groupId>org.apache.aries.proxy</groupId>
102 <artifactId>org.apache.aries.proxy.impl</artifactId>
103 <version>1.0.5</version>
110 <groupId>org.eclipse.m2e</groupId>
111 <artifactId>lifecycle-mapping</artifactId>
112 <version>1.0.0</version>
114 <lifecycleMappingMetadata>
117 <pluginExecutionFilter>
118 <groupId>org.apache.felix</groupId>
119 <artifactId>maven-bundle-plugin</artifactId>
120 <versionRange>[0,)</versionRange>
122 <goal>cleanVersions</goal>
124 </pluginExecutionFilter>
130 <pluginExecutionFilter>
131 <groupId>org.apache.maven.plugins</groupId>
132 <artifactId>maven-dependency-plugin</artifactId>
133 <versionRange>[0,)</versionRange>
138 </pluginExecutionFilter>
144 <pluginExecutionFilter>
145 <groupId>org.apache.karaf.tooling</groupId>
146 <artifactId>karaf-maven-plugin</artifactId>
147 <versionRange>[0,)</versionRange>
149 <goal>commands-generate-help</goal>
150 <goal>features-add-to-repository</goal>
151 <goal>install-kars</goal>
153 </pluginExecutionFilter>
159 <pluginExecutionFilter>
160 <groupId>org.fusesource.scalate</groupId>
161 <artifactId>maven-scalate-plugin</artifactId>
162 <versionRange>[0,)</versionRange>
166 </pluginExecutionFilter>
172 <pluginExecutionFilter>
173 <groupId>org.apache.servicemix.tooling</groupId>
174 <artifactId>depends-maven-plugin</artifactId>
175 <versionRange>[0,)</versionRange>
177 <goal>generate-depends-file</goal>
179 </pluginExecutionFilter>
185 </lifecycleMappingMetadata>
190 <artifactId>maven-resources-plugin</artifactId>
193 <id>copy-resources</id>
194 <!-- here the phase you need -->
195 <phase>prepare-package</phase>
197 <goal>copy-resources</goal>
200 <outputDirectory>${basedir}/target/assembly</outputDirectory>
203 <directory>src/main/assembly</directory>
206 <overwrite>true</overwrite>
212 <groupId>org.apache.karaf.tooling</groupId>
213 <artifactId>karaf-maven-plugin</artifactId>
214 <version>${karaf.maven.version}</version>
215 <extensions>true</extensions>
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
221 <feature>eventadmin</feature>
224 <feature>standard</feature>
225 <feature>${karaf.localFeature}</feature>
227 <!-- no installedFeatures -->
231 <id>populate-system</id>
232 <phase>generate-resources</phase>
234 <goal>features-add-to-repository</goal>
238 <descriptor>mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features</descriptor>
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>
249 <repository>target/assembly/system</repository>
253 <id>process-resources</id>
255 <goal>install-kars</goal>
257 <phase>process-resources</phase>
262 <goal>instance-create-archive</goal>
265 <archiveTarGz>${karaf.archiveTarGz}</archiveTarGz>
266 <archiveZip>${karaf.archiveZip}</archiveZip>
272 <groupId>org.apache.maven.plugins</groupId>
273 <artifactId>maven-checkstyle-plugin</artifactId>
274 <version>${checkstyle.version}</version>
276 <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/configuration\/initial\/</excludes>
280 <groupId>org.apache.maven.plugins</groupId>
281 <artifactId>maven-dependency-plugin</artifactId>
288 <!-- here the phase you need -->
289 <phase>generate-resources</phase>
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>
303 <id>unpack-karaf-resources</id>
305 <goal>unpack-dependencies</goal>
307 <phase>prepare-package</phase>
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>
318 <id>org.ops4j.pax.url.mvn.cfg</id>
322 <phase>prepare-package</phase>
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>
335 <overWriteReleases>true</overWriteReleases>
336 <overWriteSnapshots>true</overWriteSnapshots>
340 <id>copy-dependencies</id>
341 <phase>prepare-package</phase>
343 <goal>copy-dependencies</goal>
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>
359 <groupId>org.apache.maven.plugins</groupId>
360 <artifactId>maven-antrun-plugin</artifactId>
363 <phase>prepare-package</phase>
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"/>
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"/>
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"/>
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"/>
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"/>
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"/>
406 <delete file="${project.build.directory}/assembly/lib/endorsed/org.apache.servicemix.bundles.xalan-2.7.2_3.jar" />
417 <groupId>org.apache.maven.plugins</groupId>
418 <artifactId>maven-enforcer-plugin</artifactId>
419 <version>${enforcer.version}</version>
422 <id>enforce-maven</id>
428 <requireMavenVersion>
429 <version>3.1.1</version>
430 </requireMavenVersion>
437 <artifactId>maven-resources-plugin</artifactId>
440 <groupId>org.apache.karaf.tooling</groupId>
441 <artifactId>karaf-maven-plugin</artifactId>
444 <groupId>org.apache.maven.plugins</groupId>
445 <artifactId>maven-checkstyle-plugin</artifactId>
448 <groupId>org.apache.maven.plugins</groupId>
449 <artifactId>maven-dependency-plugin</artifactId>
452 <groupId>org.apache.maven.plugins</groupId>
453 <artifactId>maven-antrun-plugin</artifactId>