a00bd0eda05bb7b796631e21f5204c1fca666cd1
[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.0-SNAPSHOT</version>
18         <relativePath>../../odlparent</relativePath>
19     </parent>
20
21     <groupId>org.opendaylight.odlparent</groupId>
22     <artifactId>karaf4-parent</artifactId>
23     <version>1.8.0-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             <dependency>
55                 <groupId>org.apache.karaf.features</groupId>
56                 <artifactId>spring</artifactId>
57                 <version>${karaf4.version}</version>
58                 <classifier>features</classifier>
59                 <type>xml</type>
60             </dependency>
61         </dependencies>
62     </dependencyManagement>
63
64     <dependencies>
65         <dependency>
66             <groupId>org.apache.karaf.features</groupId>
67             <artifactId>framework</artifactId>
68             <type>kar</type>
69         </dependency>
70         <dependency>
71             <groupId>org.apache.karaf.features</groupId>
72             <artifactId>framework</artifactId>
73             <classifier>features</classifier>
74             <type>xml</type>
75             <scope>runtime</scope>
76         </dependency>
77         <dependency>
78             <groupId>org.apache.karaf.features</groupId>
79             <artifactId>standard</artifactId>
80             <classifier>features</classifier>
81             <type>xml</type>
82             <scope>runtime</scope>
83         </dependency>
84         <dependency>
85             <groupId>org.apache.karaf.features</groupId>
86             <artifactId>spring</artifactId>
87             <classifier>features</classifier>
88             <type>xml</type>
89             <scope>runtime</scope>
90         </dependency>
91
92         <!-- ODL Branding -->
93         <dependency>
94             <groupId>org.opendaylight.odlparent</groupId>
95             <artifactId>karaf.branding</artifactId>
96         </dependency>
97         <!-- ODL configuration -->
98         <dependency>
99             <groupId>org.opendaylight.odlparent</groupId>
100             <artifactId>opendaylight-karaf4-resources</artifactId>
101         </dependency>
102     </dependencies>
103
104     <build>
105         <plugins>
106             <plugin>
107                 <groupId>org.apache.maven.plugins</groupId>
108                 <artifactId>maven-resources-plugin</artifactId>
109                 <executions>
110                     <execution>
111                         <id>process-resources</id>
112                         <goals>
113                             <goal>resources</goal>
114                         </goals>
115                     </execution>
116                 </executions>
117             </plugin>
118             <plugin>
119                 <groupId>org.apache.maven.plugins</groupId>
120                 <artifactId>maven-remote-resources-plugin</artifactId>
121                 <configuration>
122                     <skip>true</skip>
123                 </configuration>
124             </plugin>
125             <plugin>
126                 <groupId>org.apache.maven.plugins</groupId>
127                 <artifactId>maven-dependency-plugin</artifactId>
128                 <executions>
129                     <execution>
130                         <id>copy</id>
131                         <goals>
132                             <goal>copy</goal>
133                         </goals>
134                         <phase>prepare-package</phase>
135                         <configuration>
136                             <artifactItems>
137                                 <artifactItem>
138                                     <groupId>org.opendaylight.odlparent</groupId>
139                                     <artifactId>karaf.branding</artifactId>
140                                     <version>1.8.0-SNAPSHOT</version>
141                                     <outputDirectory>target/assembly/lib</outputDirectory>
142                                     <destFileName>karaf.branding-1.8.0-SNAPSHOT.jar</destFileName>
143                                 </artifactItem>
144                             </artifactItems>
145                         </configuration>
146                     </execution>
147                     <execution>
148                         <id>unpack-karaf-resources</id>
149                         <goals>
150                             <goal>unpack-dependencies</goal>
151                         </goals>
152                         <phase>prepare-package</phase>
153                         <configuration>
154                             <outputDirectory>${project.build.directory}/assembly</outputDirectory>
155                             <groupId>org.opendaylight.odlparent</groupId>
156                             <includeArtifactIds>opendaylight-karaf4-resources</includeArtifactIds>
157                             <excludes>META-INF\/**</excludes>
158                             <excludeTransitive>true</excludeTransitive>
159                             <ignorePermissions>false</ignorePermissions>
160                         </configuration>
161                     </execution>
162                     <execution>
163                         <id>org.ops4j.pax.url.mvn.cfg</id>
164                         <goals>
165                             <goal>copy</goal>
166                         </goals>
167                         <phase>prepare-package</phase>
168                         <configuration>
169                             <artifactItems>
170                                 <artifactItem>
171                                     <groupId>org.opendaylight.odlparent</groupId>
172                                     <artifactId>opendaylight-karaf4-resources</artifactId>
173                                     <type>properties</type>
174                                     <classifier>config</classifier>
175                                     <overWrite>true</overWrite>
176                                     <outputDirectory>${project.build.directory}/assembly/etc/</outputDirectory>
177                                     <destFileName>org.ops4j.pax.url.mvn.cfg</destFileName>
178                                 </artifactItem>
179                             </artifactItems>
180                             <overWriteReleases>true</overWriteReleases>
181                             <overWriteSnapshots>true</overWriteSnapshots>
182                         </configuration>
183                     </execution>
184                 </executions>
185             </plugin>
186
187             <!-- This needs to execute before patching, otherwise the feature will be left unpatched -->
188             <plugin>
189                 <groupId>org.opendaylight.odlparent</groupId>
190                 <artifactId>karaf4-plugin</artifactId>
191                 <version>1.8.0-SNAPSHOT</version>
192                 <executions>
193                     <execution>
194                         <id>populate-local-repo</id>
195                         <goals>
196                             <goal>populate-local-repo</goal>
197                         </goals>
198                         <configuration>
199                             <localRepo>${project.build.directory}/assembly/system</localRepo>
200                         </configuration>
201                     </execution>
202                 </executions>
203             </plugin>
204             <plugin>
205                 <artifactId>maven-antrun-plugin</artifactId>
206                 <executions>
207                     <execution>
208                         <id>patch-karaf-scripts</id>
209                         <phase>prepare-package</phase>
210                         <goals>
211                             <goal>run</goal>
212                         </goals>
213                         <configuration>
214                             <target>
215                                 <!-- Patches only work with LF line endings from ant -->
216                                 <fixcrlf srcdir="${project.build.directory}/assembly/bin"
217                                          includes="*.bat" eol="lf"/>
218                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-instance.patch"
219                                        originalfile="${project.build.directory}/assembly/bin/instance"
220                                        failonerror="true"/>
221                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-instance.bat.patch"
222                                        originalfile="${project.build.directory}/assembly/bin/instance.bat"
223                                        failonerror="true" ignorewhitespace="true"/>
224                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-karaf.patch"
225                                        originalfile="${project.build.directory}/assembly/bin/karaf"
226                                        failonerror="true"/>
227                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-karaf.bat.patch"
228                                        originalfile="${project.build.directory}/assembly/bin/karaf.bat"
229                                        failonerror="true"/>
230                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-setenv.patch"
231                                        originalfile="${project.build.directory}/assembly/bin/setenv"
232                                        failonerror="true"/>
233                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-setenv.bat.patch"
234                                        originalfile="${project.build.directory}/assembly/bin/setenv.bat"
235                                        failonerror="true"/>
236                                 <patch patchfile="${project.build.directory}/assembly/patches/karaf-quiesce-4.0.7.patch"
237                                        originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/4.0.7/standard-4.0.7-features.xml"
238                                        failonerror="true"/>
239                                 <fixcrlf srcdir="${project.build.directory}/assembly/bin"
240                                          includes="*.bat" eol="crlf"/>
241                             </target>
242                         </configuration>
243                     </execution>
244                 </executions>
245             </plugin>
246             <plugin>
247                 <groupId>org.apache.karaf.tooling</groupId>
248                 <artifactId>karaf-maven-plugin</artifactId>
249                 <version>${karaf4.plugin.version}</version>
250                 <executions>
251                     <execution>
252                         <id>process-resources</id>
253                         <phase>process-resources</phase>
254                         <goals>
255                             <goal>assembly</goal>
256                         </goals>
257                     </execution>
258                     <execution>
259                         <id>package</id>
260                         <goals>
261                             <goal>archive</goal>
262                         </goals>
263                     </execution>
264                 </executions>
265                 <configuration>
266                     <installedFeatures>
267                         <feature>wrapper</feature>
268                     </installedFeatures>
269                     <bootFeatures>
270                         <feature>standard</feature>
271                         <feature>war</feature>
272                         <!-- We load wrap as a workaround to handle old features without the wrap prerequisite -->
273                         <!-- TODO Remove this once all the downstream features are fixed -->
274                         <feature>wrap</feature>
275                         <!-- Local feature if any -->
276                         <feature>${karaf.localFeature}</feature>
277                     </bootFeatures>
278                     <javase>1.8</javase>
279                 </configuration>
280             </plugin>
281         </plugins>
282     </build>
283
284 </project>