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