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