Merge "Introducing karaf-parent (and also group karaf things)"
[controller.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.5.0-SNAPSHOT</version>
15     <relativePath/>
16   </parent>
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>
22   <prerequisites>
23     <maven>3.1.1</maven>
24   </prerequisites>
25   <properties>
26     <branding.version>1.1.0-SNAPSHOT</branding.version>
27     <karaf.resources.version>1.5.0-SNAPSHOT</karaf.resources.version>
28   </properties>
29   <dependencyManagement>
30     <dependencies>
31       <dependency>
32         <!-- scope is compile so all features (there is only one) are installed
33         into startup.properties and the feature repo itself is not installed -->
34         <groupId>org.apache.karaf.features</groupId>
35         <artifactId>framework</artifactId>
36         <version>${karaf.version}</version>
37         <type>kar</type>
38         <exclusions>
39           <exclusion>
40             <groupId>org.osgi</groupId>
41             <artifactId>org.osgi.core</artifactId>
42           </exclusion>
43           <exclusion>
44             <groupId>org.apache.sshd</groupId>
45             <artifactId>sshd-core</artifactId>
46           </exclusion>
47         </exclusions>
48       </dependency>
49     </dependencies>
50   </dependencyManagement>
51   <dependencies>
52     <!-- ODL Branding -->
53     <dependency>
54       <groupId>org.opendaylight.controller</groupId>
55       <artifactId>karaf.branding</artifactId>
56       <version>${branding.version}</version>
57       <scope>compile</scope>
58     </dependency>
59
60     <!-- Resources needed -->
61     <dependency>
62       <groupId>org.opendaylight.controller</groupId>
63       <artifactId>opendaylight-karaf-resources</artifactId>
64       <version>${karaf.resources.version}</version>
65     </dependency>
66   </dependencies>
67   <build>
68     <pluginManagement>
69       <plugins>
70         <plugin>
71           <groupId>org.eclipse.m2e</groupId>
72           <artifactId>lifecycle-mapping</artifactId>
73           <version>1.0.0</version>
74           <configuration>
75             <lifecycleMappingMetadata>
76               <pluginExecutions>
77                 <pluginExecution>
78                   <pluginExecutionFilter>
79                     <groupId>org.apache.felix</groupId>
80                     <artifactId>maven-bundle-plugin</artifactId>
81                     <versionRange>[0,)</versionRange>
82                     <goals>
83                       <goal>cleanVersions</goal>
84                     </goals>
85                   </pluginExecutionFilter>
86                   <action>
87                     <ignore></ignore>
88                   </action>
89                 </pluginExecution>
90                 <pluginExecution>
91                   <pluginExecutionFilter>
92                     <groupId>org.apache.maven.plugins</groupId>
93                     <artifactId>maven-dependency-plugin</artifactId>
94                     <versionRange>[0,)</versionRange>
95                     <goals>
96                       <goal>copy</goal>
97                       <goal>unpack</goal>
98                     </goals>
99                   </pluginExecutionFilter>
100                   <action>
101                     <ignore></ignore>
102                   </action>
103                 </pluginExecution>
104                 <pluginExecution>
105                   <pluginExecutionFilter>
106                     <groupId>org.apache.karaf.tooling</groupId>
107                     <artifactId>karaf-maven-plugin</artifactId>
108                     <versionRange>[0,)</versionRange>
109                     <goals>
110                       <goal>commands-generate-help</goal>
111                       <goal>features-add-to-repository</goal>
112                       <goal>install-kars</goal>
113                     </goals>
114                   </pluginExecutionFilter>
115                   <action>
116                     <ignore></ignore>
117                   </action>
118                 </pluginExecution>
119                 <pluginExecution>
120                   <pluginExecutionFilter>
121                     <groupId>org.fusesource.scalate</groupId>
122                     <artifactId>maven-scalate-plugin</artifactId>
123                     <versionRange>[0,)</versionRange>
124                     <goals>
125                       <goal>sitegen</goal>
126                     </goals>
127                   </pluginExecutionFilter>
128                   <action>
129                     <ignore></ignore>
130                   </action>
131                 </pluginExecution>
132                 <pluginExecution>
133                   <pluginExecutionFilter>
134                     <groupId>org.apache.servicemix.tooling</groupId>
135                     <artifactId>depends-maven-plugin</artifactId>
136                     <versionRange>[0,)</versionRange>
137                     <goals>
138                       <goal>generate-depends-file</goal>
139                     </goals>
140                   </pluginExecutionFilter>
141                   <action>
142                     <ignore></ignore>
143                   </action>
144                 </pluginExecution>
145               </pluginExecutions>
146             </lifecycleMappingMetadata>
147           </configuration>
148         </plugin>
149
150         <plugin>
151           <artifactId>maven-resources-plugin</artifactId>
152           <executions>
153             <execution>
154               <id>copy-resources</id>
155               <!-- here the phase you need -->
156               <phase>prepare-package</phase>
157               <goals>
158                 <goal>copy-resources</goal>
159               </goals>
160               <configuration>
161                 <outputDirectory>${basedir}/target/assembly</outputDirectory>
162                 <resources>
163                   <resource>
164                     <directory>src/main/assembly</directory>
165                   </resource>
166                 </resources>
167                 <overwrite>true</overwrite>
168               </configuration>
169             </execution>
170           </executions>
171         </plugin>
172         <plugin>
173           <groupId>org.apache.karaf.tooling</groupId>
174           <artifactId>karaf-maven-plugin</artifactId>
175           <version>${karaf.version}</version>
176           <extensions>true</extensions>
177           <configuration>
178             <!-- no startupFeatures -->
179             <bootFeatures>
180               <feature>standard</feature>
181             </bootFeatures>
182             <!-- no installedFeatures -->
183           </configuration>
184           <executions>
185             <execution>
186               <id>populate-system</id>
187               <phase>generate-resources</phase>
188               <goals>
189                 <goal>features-add-to-repository</goal>
190               </goals>
191               <configuration>
192                 <descriptors>
193                   <descriptor>mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features</descriptor>
194                 </descriptors>
195                 <features>
196                   <feature>standard</feature>
197                   <feature>config</feature>
198                   <feature>package</feature>
199                   <feature>kar</feature>
200                   <feature>ssh</feature>
201                   <feature>management</feature>
202                   <feature>war</feature>
203                 </features>
204                 <repository>target/assembly/system</repository>
205               </configuration>
206             </execution>
207             <execution>
208               <id>process-resources</id>
209               <goals>
210                 <goal>install-kars</goal>
211               </goals>
212               <phase>process-resources</phase>
213             </execution>
214             <execution>
215               <id>package</id>
216               <goals>
217                 <goal>instance-create-archive</goal>
218               </goals>
219             </execution>
220           </executions>
221         </plugin>
222         <plugin>
223           <groupId>org.apache.maven.plugins</groupId>
224           <artifactId>maven-checkstyle-plugin</artifactId>
225           <version>${checkstyle.version}</version>
226           <configuration>
227             <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,**\/configuration\/initial\/</excludes>
228           </configuration>
229         </plugin>
230         <plugin>
231           <groupId>org.apache.maven.plugins</groupId>
232           <artifactId>maven-dependency-plugin</artifactId>
233           <executions>
234             <execution>
235               <id>copy</id>
236               <goals>
237                 <goal>copy</goal>
238               </goals>
239               <!-- here the phase you need -->
240               <phase>generate-resources</phase>
241               <configuration>
242                 <artifactItems>
243                   <artifactItem>
244                     <groupId>org.opendaylight.controller</groupId>
245                     <artifactId>karaf.branding</artifactId>
246                     <version>${karaf.branding.version}</version>
247                     <outputDirectory>target/assembly/lib</outputDirectory>
248                     <destFileName>karaf.branding-${branding.version}.jar</destFileName>
249                   </artifactItem>
250                 </artifactItems>
251               </configuration>
252             </execution>
253             <execution>
254               <id>unpack-karaf-resources</id>
255               <goals>
256                 <goal>unpack-dependencies</goal>
257               </goals>
258               <phase>prepare-package</phase>
259               <configuration>
260                 <outputDirectory>${project.build.directory}/assembly</outputDirectory>
261                 <groupId>org.opendaylight.controller</groupId>
262                 <includeArtifactIds>opendaylight-karaf-resources</includeArtifactIds>
263                 <excludes>META-INF\/**</excludes>
264                 <excludeTransitive>true</excludeTransitive>
265                 <ignorePermissions>false</ignorePermissions>
266               </configuration>
267             </execution>
268             <execution>
269               <id>org.ops4j.pax.url.mvn.cfg</id>
270               <goals>
271                 <goal>copy</goal>
272               </goals>
273               <phase>prepare-package</phase>
274               <configuration>
275                 <artifactItems>
276                   <artifactItem>
277                     <groupId>org.opendaylight.controller</groupId>
278                     <artifactId>opendaylight-karaf-resources</artifactId>
279                     <type>properties</type>
280                     <classifier>config</classifier>
281                     <overWrite>true</overWrite>
282                     <outputDirectory>${project.build.directory}/assembly/etc/</outputDirectory>
283                     <destFileName>org.ops4j.pax.url.mvn.cfg</destFileName>
284                   </artifactItem>
285                 </artifactItems>
286                 <overWriteReleases>true</overWriteReleases>
287                 <overWriteSnapshots>true</overWriteSnapshots>
288               </configuration>
289             </execution>
290           </executions>
291         </plugin>
292         <plugin>
293           <groupId>org.apache.maven.plugins</groupId>
294           <artifactId>maven-antrun-plugin</artifactId>
295           <executions>
296             <execution>
297               <phase>prepare-package</phase>
298               <goals>
299                 <goal>run</goal>
300               </goals>
301               <configuration>
302                 <tasks>
303                   <chmod perm="755">
304                     <fileset dir="${project.build.directory}/assembly/bin">
305                       <include name="karaf"/>
306                       <include name="instance"/>
307                       <include name="start"/>
308                       <include name="stop"/>
309                       <include name="status"/>
310                       <include name="client"/>
311                       <include name="shell"/>
312                     </fileset>
313                   </chmod>
314                 </tasks>
315               </configuration>
316             </execution>
317           </executions>
318         </plugin>
319       </plugins>
320     </pluginManagement>
321     <plugins>
322       <plugin>
323         <artifactId>maven-resources-plugin</artifactId>
324       </plugin>
325       <plugin>
326         <groupId>org.apache.karaf.tooling</groupId>
327         <artifactId>karaf-maven-plugin</artifactId>
328       </plugin>
329       <plugin>
330         <groupId>org.apache.maven.plugins</groupId>
331         <artifactId>maven-checkstyle-plugin</artifactId>
332       </plugin>
333       <plugin>
334         <groupId>org.apache.maven.plugins</groupId>
335         <artifactId>maven-dependency-plugin</artifactId>
336       </plugin>
337       <plugin>
338         <groupId>org.apache.maven.plugins</groupId>
339         <artifactId>maven-antrun-plugin</artifactId>
340       </plugin>
341     </plugins>
342   </build>
343
344 </project>