${project.build.directory} in maven-bundle-plugin
[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>2.1.0-SNAPSHOT</version>
18         <relativePath>../../odlparent</relativePath>
19     </parent>
20
21     <groupId>org.opendaylight.odlparent</groupId>
22     <artifactId>karaf4-parent</artifactId>
23     <version>2.1.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>${karaf.version}</version>
38                 <type>kar</type>
39             </dependency>
40             <dependency>
41                 <groupId>org.apache.karaf.features</groupId>
42                 <artifactId>framework</artifactId>
43                 <version>${karaf.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>${karaf.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         <dependency>
78             <groupId>org.apache.aries.quiesce</groupId>
79             <artifactId>org.apache.aries.quiesce.api</artifactId>
80         </dependency>
81         <dependency>
82             <groupId>org.osgi</groupId>
83             <!-- for https://bugs.opendaylight.org/show_bug.cgi?id=4290 -->
84             <artifactId>org.osgi.service.event</artifactId>
85         </dependency>
86         <dependency>
87             <groupId>org.bouncycastle</groupId>
88             <artifactId>bcprov-jdk15on</artifactId>
89         </dependency>
90
91         <!-- ODL Branding -->
92         <dependency>
93             <groupId>org.opendaylight.odlparent</groupId>
94             <artifactId>karaf.branding</artifactId>
95         </dependency>
96         <!-- ODL configuration -->
97         <dependency>
98             <groupId>org.opendaylight.odlparent</groupId>
99             <artifactId>opendaylight-karaf-resources</artifactId>
100         </dependency>
101     </dependencies>
102
103     <build>
104         <plugins>
105             <plugin>
106                 <artifactId>maven-remote-resources-plugin</artifactId>
107                 <configuration>
108                     <skip>true</skip>
109                 </configuration>
110             </plugin>
111             <plugin>
112                 <groupId>org.opendaylight.odlparent</groupId>
113                 <artifactId>karaf-plugin</artifactId>
114                 <version>2.1.0-SNAPSHOT</version>
115                 <executions>
116                     <execution>
117                         <id>populate-local-repo</id>
118                         <phase>prepare-package</phase>
119                         <goals>
120                             <goal>populate-local-repo</goal>
121                         </goals>
122                         <configuration>
123                             <localRepo>${project.build.directory}/assembly/system</localRepo>
124                         </configuration>
125                     </execution>
126                 </executions>
127             </plugin>
128             <plugin>
129                 <groupId>org.apache.maven.plugins</groupId>
130                 <artifactId>maven-dependency-plugin</artifactId>
131                 <executions>
132                     <execution>
133                         <id>copy</id>
134                         <goals>
135                             <goal>copy</goal>
136                         </goals>
137                         <phase>prepare-package</phase>
138                         <configuration>
139                             <artifactItems>
140                                 <artifactItem>
141                                     <groupId>org.opendaylight.odlparent</groupId>
142                                     <artifactId>karaf.branding</artifactId>
143                                     <version>2.1.0-SNAPSHOT</version>
144                                     <outputDirectory>target/assembly/lib</outputDirectory>
145                                     <destFileName>karaf.branding-2.1.0-SNAPSHOT.jar</destFileName>
146                                 </artifactItem>
147                             </artifactItems>
148                         </configuration>
149                     </execution>
150                     <execution>
151                         <id>unpack-karaf-resources</id>
152                         <goals>
153                             <goal>unpack-dependencies</goal>
154                         </goals>
155                         <phase>prepare-package</phase>
156                         <configuration>
157                             <outputDirectory>${project.build.directory}/assembly</outputDirectory>
158                             <groupId>org.opendaylight.odlparent</groupId>
159                             <includeArtifactIds>opendaylight-karaf-resources</includeArtifactIds>
160                             <excludes>META-INF\/**</excludes>
161                             <excludeTransitive>true</excludeTransitive>
162                             <ignorePermissions>false</ignorePermissions>
163                         </configuration>
164                     </execution>
165                     <execution>
166                         <id>org.ops4j.pax.url.mvn.cfg</id>
167                         <goals>
168                             <goal>copy</goal>
169                         </goals>
170                         <phase>prepare-package</phase>
171                         <configuration>
172                             <artifactItems>
173                                 <artifactItem>
174                                     <groupId>org.opendaylight.odlparent</groupId>
175                                     <artifactId>opendaylight-karaf-resources</artifactId>
176                                     <type>properties</type>
177                                     <classifier>config</classifier>
178                                     <overWrite>true</overWrite>
179                                     <outputDirectory>${project.build.directory}/assembly/etc/</outputDirectory>
180                                     <destFileName>org.ops4j.pax.url.mvn.cfg</destFileName>
181                                 </artifactItem>
182                             </artifactItems>
183                             <overWriteReleases>true</overWriteReleases>
184                             <overWriteSnapshots>true</overWriteSnapshots>
185                         </configuration>
186                     </execution>
187                 </executions>
188             </plugin>
189             <plugin>
190                 <artifactId>maven-resources-plugin</artifactId>
191                 <executions>
192                     <execution>
193                         <id>copy-resources</id>
194                         <phase>prepare-package</phase>
195                         <goals>
196                             <goal>copy-resources</goal>
197                         </goals>
198                         <configuration>
199                             <outputDirectory>${basedir}/target/assembly</outputDirectory>
200                             <resources>
201                                 <resource>
202                                     <directory>src/main/assembly</directory>
203                                 </resource>
204                             </resources>
205                             <overwrite>true</overwrite>
206                         </configuration>
207                     </execution>
208                     <execution>
209                         <id>process-resources</id>
210                         <goals>
211                             <goal>resources</goal>
212                         </goals>
213                     </execution>
214                 </executions>
215             </plugin>
216             <plugin>
217                 <artifactId>maven-antrun-plugin</artifactId>
218                 <executions>
219                     <execution>
220                         <id>fix-permissions</id>
221                         <phase>prepare-package</phase>
222                         <goals>
223                             <goal>run</goal>
224                         </goals>
225                         <configuration>
226                             <target>
227                                 <chmod perm="755">
228                                     <fileset dir="${project.build.directory}/assembly/bin">
229                                         <!-- Ensure that all the shell scripts are executable -->
230                                         <exclude name="*.bat"/>
231                                         <exclude name="contrib/*"/>
232                                     </fileset>
233                                 </chmod>
234                             </target>
235                         </configuration>
236                     </execution>
237                 </executions>
238             </plugin>
239             <plugin>
240                 <groupId>org.apache.karaf.tooling</groupId>
241                 <artifactId>karaf-maven-plugin</artifactId>
242                 <version>${karaf.plugin.version}</version>
243                 <executions>
244                     <execution>
245                         <id>process-resources</id>
246                         <phase>process-resources</phase>
247                         <goals>
248                             <goal>assembly</goal>
249                         </goals>
250                     </execution>
251                     <execution>
252                         <id>package</id>
253                         <goals>
254                             <goal>archive</goal>
255                         </goals>
256                     </execution>
257                 </executions>
258                 <configuration>
259                     <installedFeatures>
260                         <feature>wrapper</feature>
261                     </installedFeatures>
262                     <bootFeatures>
263                         <feature>standard</feature>
264                         <!-- We load wrap as a workaround to handle old features without the wrap prerequisite -->
265                         <!-- TODO Remove this once all the downstream features are fixed -->
266                         <feature>wrap</feature>
267                         <!-- Local feature if any -->
268                         <feature>${karaf.localFeature}</feature>
269                     </bootFeatures>
270                     <javase>1.8</javase>
271                 </configuration>
272             </plugin>
273         </plugins>
274     </build>
275 </project>