4cb09e43d80e625cebf757bcb4971f4531e3b317
[odlparent.git] / karaf / karaf4-parent / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  Copyright © 2016 Red Hat, 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"
10          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12     <modelVersion>4.0.0</modelVersion>
13
14     <parent>
15         <groupId>org.opendaylight.odlparent</groupId>
16         <artifactId>odlparent</artifactId>
17         <version>1.8.2-SNAPSHOT</version>
18         <relativePath>../../odlparent</relativePath>
19     </parent>
20
21     <groupId>org.opendaylight.odlparent</groupId>
22     <artifactId>karaf4-parent</artifactId>
23     <version>1.8.2-SNAPSHOT</version>
24     <packaging>pom</packaging>
25     <name>ODL :: odlparent :: ${project.artifactId}</name>
26
27     <properties>
28         <!-- Projects can override this to add their own boot feature -->
29         <karaf.localFeature>standard</karaf.localFeature>
30     </properties>
31
32     <dependencyManagement>
33         <dependencies>
34             <dependency>
35                 <groupId>org.apache.karaf.features</groupId>
36                 <artifactId>framework</artifactId>
37                 <version>${karaf4.version}</version>
38                 <type>kar</type>
39             </dependency>
40             <dependency>
41                 <groupId>org.apache.karaf.features</groupId>
42                 <artifactId>framework</artifactId>
43                 <version>${karaf4.version}</version>
44                 <classifier>features</classifier>
45                 <type>xml</type>
46             </dependency>
47             <dependency>
48                 <groupId>org.apache.karaf.features</groupId>
49                 <artifactId>standard</artifactId>
50                 <version>${karaf4.version}</version>
51                 <classifier>features</classifier>
52                 <type>xml</type>
53             </dependency>
54         </dependencies>
55     </dependencyManagement>
56
57     <dependencies>
58         <dependency>
59             <groupId>org.apache.karaf.features</groupId>
60             <artifactId>framework</artifactId>
61             <type>kar</type>
62         </dependency>
63         <dependency>
64             <groupId>org.apache.karaf.features</groupId>
65             <artifactId>framework</artifactId>
66             <classifier>features</classifier>
67             <type>xml</type>
68             <scope>runtime</scope>
69         </dependency>
70         <dependency>
71             <groupId>org.apache.karaf.features</groupId>
72             <artifactId>standard</artifactId>
73             <classifier>features</classifier>
74             <type>xml</type>
75             <scope>runtime</scope>
76         </dependency>
77
78         <!-- ODL Branding -->
79         <dependency>
80             <groupId>org.opendaylight.odlparent</groupId>
81             <artifactId>karaf.branding</artifactId>
82         </dependency>
83         <!-- ODL configuration -->
84         <dependency>
85             <groupId>org.opendaylight.odlparent</groupId>
86             <artifactId>opendaylight-karaf4-resources</artifactId>
87         </dependency>
88     </dependencies>
89
90     <build>
91         <plugins>
92             <plugin>
93                 <artifactId>maven-resources-plugin</artifactId>
94                 <executions>
95                     <execution>
96                         <id>process-resources</id>
97                         <goals>
98                             <goal>resources</goal>
99                         </goals>
100                     </execution>
101                 </executions>
102             </plugin>
103             <plugin>
104                 <artifactId>maven-remote-resources-plugin</artifactId>
105                 <configuration>
106                     <skip>true</skip>
107                 </configuration>
108             </plugin>
109             <plugin>
110                 <groupId>org.apache.maven.plugins</groupId>
111                 <artifactId>maven-dependency-plugin</artifactId>
112                 <executions>
113                     <execution>
114                         <id>copy</id>
115                         <goals>
116                             <goal>copy</goal>
117                         </goals>
118                         <phase>prepare-package</phase>
119                         <configuration>
120                             <artifactItems>
121                                 <artifactItem>
122                                     <groupId>org.opendaylight.odlparent</groupId>
123                                     <artifactId>karaf.branding</artifactId>
124                                     <version>1.8.2-SNAPSHOT</version>
125                                     <outputDirectory>target/assembly/lib</outputDirectory>
126                                     <destFileName>karaf.branding-1.8.2-SNAPSHOT.jar</destFileName>
127                                 </artifactItem>
128                             </artifactItems>
129                         </configuration>
130                     </execution>
131                     <execution>
132                         <id>unpack-karaf-resources</id>
133                         <goals>
134                             <goal>unpack-dependencies</goal>
135                         </goals>
136                         <phase>prepare-package</phase>
137                         <configuration>
138                             <outputDirectory>${project.build.directory}/assembly</outputDirectory>
139                             <groupId>org.opendaylight.odlparent</groupId>
140                             <includeArtifactIds>opendaylight-karaf4-resources</includeArtifactIds>
141                             <excludes>META-INF\/**</excludes>
142                             <excludeTransitive>true</excludeTransitive>
143                             <ignorePermissions>false</ignorePermissions>
144                         </configuration>
145                     </execution>
146                     <execution>
147                         <id>org.ops4j.pax.url.mvn.cfg</id>
148                         <goals>
149                             <goal>copy</goal>
150                         </goals>
151                         <phase>prepare-package</phase>
152                         <configuration>
153                             <artifactItems>
154                                 <artifactItem>
155                                     <groupId>org.opendaylight.odlparent</groupId>
156                                     <artifactId>opendaylight-karaf4-resources</artifactId>
157                                     <type>properties</type>
158                                     <classifier>config</classifier>
159                                     <overWrite>true</overWrite>
160                                     <outputDirectory>${project.build.directory}/assembly/etc/</outputDirectory>
161                                     <destFileName>org.ops4j.pax.url.mvn.cfg</destFileName>
162                                 </artifactItem>
163                             </artifactItems>
164                             <overWriteReleases>true</overWriteReleases>
165                             <overWriteSnapshots>true</overWriteSnapshots>
166                         </configuration>
167                     </execution>
168                 </executions>
169             </plugin>
170
171             <!-- This needs to execute before patching, otherwise the feature will be left unpatched -->
172             <plugin>
173                 <groupId>org.opendaylight.odlparent</groupId>
174                 <artifactId>karaf4-plugin</artifactId>
175                 <version>1.8.2-SNAPSHOT</version>
176                 <executions>
177                     <execution>
178                         <id>populate-local-repo</id>
179                         <goals>
180                             <goal>populate-local-repo</goal>
181                         </goals>
182                         <configuration>
183                             <localRepo>${project.build.directory}/assembly/system</localRepo>
184                         </configuration>
185                     </execution>
186                 </executions>
187             </plugin>
188             <plugin>
189                 <artifactId>maven-antrun-plugin</artifactId>
190                 <executions>
191                     <execution>
192                         <id>patch-karaf-scripts</id>
193                         <phase>prepare-package</phase>
194                         <goals>
195                             <goal>run</goal>
196                         </goals>
197                         <configuration>
198                             <target>
199                                 <!-- Patches only work with LF line endings from ant -->
200                                 <fixcrlf srcdir="${project.build.directory}/assembly/bin"
201                                          includes="*.bat" eol="lf"/>
202                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-instance.patch"
203                                        originalfile="${project.build.directory}/assembly/bin/instance"
204                                        failonerror="true"/>
205                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-instance.bat.patch"
206                                        originalfile="${project.build.directory}/assembly/bin/instance.bat"
207                                        failonerror="true" ignorewhitespace="true"/>
208                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-karaf-${karaf4.version}.patch"
209                                        originalfile="${project.build.directory}/assembly/bin/karaf"
210                                        failonerror="true"/>
211                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-karaf.bat.patch"
212                                        originalfile="${project.build.directory}/assembly/bin/karaf.bat"
213                                        failonerror="true"/>
214                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-setenv-${karaf4.version}.patch"
215                                        originalfile="${project.build.directory}/assembly/bin/setenv"
216                                        failonerror="true"/>
217                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-setenv.bat.patch"
218                                        originalfile="${project.build.directory}/assembly/bin/setenv.bat"
219                                        failonerror="true"/>
220                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-quiesce-${karaf4.version}.patch"
221                                        originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf4.version}/standard-${karaf4.version}-features.xml"
222                                        failonerror="true"/>
223                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-javax-mail-${karaf4.version}.patch"
224                                        originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf4.version}/standard-${karaf4.version}-features.xml"
225                                        failonerror="true"/>
226                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-paxweb.patch"
227                                        originalfile="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/4.3.0/pax-web-features-4.3.0-features.xml"
228                                        failonerror="true"/>
229                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-etc-startup-properties-4.0.9.patch"
230                                        originalfile="${project.build.directory}/assembly/etc/startup.properties"
231                                        failonerror="true"/>
232                                 <fixcrlf srcdir="${project.build.directory}/assembly/bin"
233                                          includes="*.bat" eol="crlf"/>
234                                 <echo file="${project.build.directory}/assembly/etc/system.properties" append="true">mvn\:org.osgi/org.osgi.service.event/1.3.1 = 8</echo>
235                             </target>
236                         </configuration>
237                     </execution>
238                 </executions>
239             </plugin>
240             <plugin>
241                 <groupId>org.apache.karaf.tooling</groupId>
242                 <artifactId>karaf-maven-plugin</artifactId>
243                 <version>${karaf4.plugin.version}</version>
244                 <executions>
245                     <execution>
246                         <id>process-resources</id>
247                         <phase>process-resources</phase>
248                         <goals>
249                             <goal>assembly</goal>
250                         </goals>
251                     </execution>
252                     <execution>
253                         <id>package</id>
254                         <goals>
255                             <goal>archive</goal>
256                         </goals>
257                     </execution>
258                 </executions>
259                 <configuration>
260                     <installedFeatures>
261                         <feature>wrapper</feature>
262                     </installedFeatures>
263                     <bootFeatures>
264                         <feature>standard</feature>
265                         <!-- We load wrap as a workaround to handle old features without the wrap prerequisite -->
266                         <!-- TODO Remove this once all the downstream features are fixed -->
267                         <feature>wrap</feature>
268                         <!-- Features always assumed to be present. Keep in sync with feature parent exclusions. -->
269                         <feature>ssh</feature>
270                         <!-- Local feature if any -->
271                         <feature>${karaf.localFeature}</feature>
272                     </bootFeatures>
273                     <javase>1.8</javase>
274                 </configuration>
275             </plugin>
276         </plugins>
277     </build>
278
279 </project>