701b099970470d69525df8a5a31e864df399eac6
[odlparent.git] / karaf / opendaylight-karaf-resources / 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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
10   <modelVersion>4.0.0</modelVersion>
11   <parent>
12     <groupId>org.opendaylight.odlparent</groupId>
13     <artifactId>odlparent</artifactId>
14     <version>6.0.2-SNAPSHOT</version>
15     <relativePath>../../odlparent</relativePath>
16   </parent>
17   <artifactId>opendaylight-karaf-resources</artifactId>
18   <description>Resources for opendaylight-karaf</description>
19   <packaging>jar</packaging>
20   <name>ODL :: odlparent :: ${project.artifactId}</name>
21   <properties>
22     <!-- There are a lot of duplicate classes in the dependencies below, but this is not a real issue,
23          because this is not a real Java artifact; it's just packaging.  (TODO: Ideally, this artifact should
24          just have odlparent-lite not odlparent as parent, and not run Java static code analysis tools.)
25       -->
26     <duplicate-finder.skip>true</duplicate-finder.skip>
27   </properties>
28   <dependencies>
29     <dependency>
30       <groupId>org.apache.karaf.features</groupId>
31       <artifactId>framework</artifactId>
32       <version>${karaf.version}</version>
33       <type>kar</type>
34     </dependency>
35     <dependency>
36       <groupId>org.apache.karaf.features</groupId>
37       <artifactId>standard</artifactId>
38       <version>${karaf.version}</version>
39       <classifier>features</classifier>
40       <type>xml</type>
41       <scope>runtime</scope>
42     </dependency>
43
44     <!-- BouncyCastle Framework Extension Bundles -->
45     <dependency>
46       <groupId>org.opendaylight.odlparent</groupId>
47       <artifactId>bcpkix-framework-ext</artifactId>
48       <scope>runtime</scope>
49     </dependency>
50     <dependency>
51       <groupId>org.opendaylight.odlparent</groupId>
52       <artifactId>bcprov-framework-ext</artifactId>
53       <scope>runtime</scope>
54     </dependency>
55   </dependencies>
56
57   <build>
58     <resources>
59       <resource>
60         <directory>src/main/resources</directory>
61         <filtering>false</filtering>
62       </resource>
63     </resources>
64     <plugins>
65       <plugin>
66         <artifactId>maven-antrun-plugin</artifactId>
67         <executions>
68           <execution>
69             <id>patch-karaf-scripts</id>
70             <phase>prepare-package</phase>
71             <goals>
72               <goal>run</goal>
73             </goals>
74             <configuration>
75               <target>
76                 <!-- Patches only work with LF line endings from ant -->
77                 <fixcrlf srcdir="${project.build.directory}/assembly/bin"
78                          includes="*.bat" eol="lf"/>
79                 <patch patchfile="${project.basedir}/src/main/patches/karaf-instance.patch"
80                        originalfile="${project.build.directory}/assembly/bin/instance"
81                        failonerror="true"/>
82                 <copy file="${project.build.directory}/assembly/bin/instance"
83                       tofile="${project.build.directory}/classes/bin/instance"/>
84                 <patch patchfile="${project.basedir}/src/main/patches/karaf-instance.bat.patch"
85                        originalfile="${project.build.directory}/assembly/bin/instance.bat"
86                        failonerror="true" ignorewhitespace="true"/>
87                 <copy file="${project.build.directory}/assembly/bin/instance.bat"
88                       tofile="${project.build.directory}/classes/bin/instance.bat"/>
89                 <patch patchfile="${project.basedir}/src/main/patches/karaf-inc-${karaf.version}.patch"
90                        originalfile="${project.build.directory}/assembly/bin/inc"
91                        failonerror="true"/>
92                 <copy file="${project.build.directory}/assembly/bin/inc"
93                       tofile="${project.build.directory}/classes/bin/inc"/>
94                 <patch patchfile="${project.basedir}/src/main/patches/karaf-karaf-${karaf.version}.patch"
95                        originalfile="${project.build.directory}/assembly/bin/karaf"
96                        failonerror="true"/>
97                 <copy file="${project.build.directory}/assembly/bin/karaf"
98                       tofile="${project.build.directory}/classes/bin/karaf"/>
99                 <patch patchfile="${project.basedir}/src/main/patches/karaf-karaf.bat.patch"
100                        originalfile="${project.build.directory}/assembly/bin/karaf.bat"
101                        failonerror="true"/>
102                 <copy file="${project.build.directory}/assembly/bin/karaf.bat"
103                       tofile="${project.build.directory}/classes/bin/karaf.bat"/>
104                 <patch patchfile="${project.basedir}/src/main/patches/karaf-setenv-${karaf.version}.patch"
105                        originalfile="${project.build.directory}/assembly/bin/setenv"
106                        failonerror="true"/>
107                 <copy file="${project.build.directory}/assembly/bin/setenv"
108                       tofile="${project.build.directory}/classes/bin/setenv"/>
109                 <patch patchfile="${project.basedir}/src/main/patches/karaf-setenv.bat.patch"
110                        originalfile="${project.build.directory}/assembly/bin/setenv.bat"
111                        failonerror="true"/>
112                 <copy file="${project.build.directory}/assembly/bin/setenv.bat"
113                       tofile="${project.build.directory}/classes/bin/setenv.bat"/>
114                 <patch patchfile="${project.basedir}/src/main/patches/karaf-quiesce-${karaf.version}.patch"
115                        originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
116                        failonerror="true"/>
117                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
118                          token="commons-codec/commons-codec/1.10" value="commons-codec/commons-codec/1.13" failOnNoReplacements="true"/>
119                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
120                          token="org.apache.commons/commons-lang3/3.8.1" value="org.apache.commons/commons-lang3/3.9" failOnNoReplacements="true"/>
121                 <!-- fixes https://issues.apache.org/jira/browse/KARAF-5086 -->
122                 <!-- fixes https://issues.apache.org/jira/browse/ARIES-1923 -->
123                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
124                          token="org.apache.aries.proxy/org.apache.aries.proxy/1.1.3" value="org.apache.aries.proxy/org.apache.aries.proxy/1.1.6" failOnNoReplacements="true"/>
125                 <copy file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
126                       tofile="${project.build.directory}/classes/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"/>
127                 <replace file="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/7.2.5/pax-web-features-7.2.5-features.xml"
128                          token="commons-beanutils/commons-beanutils/1.8.3" value="commons-beanutils/commons-beanutils/1.9.4" failOnNoReplacements="true"/>
129                 <replace file="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/7.2.5/pax-web-features-7.2.5-features.xml"
130                          token="commons-codec/commons-codec/1.8" value="commons-codec/commons-codec/1.13" failOnNoReplacements="true"/>
131                 <replace file="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/7.2.5/pax-web-features-7.2.5-features.xml"
132                          token="javax.mail/mail/1.4.4" value="javax.mail/mail/1.4.7" failOnNoReplacements="true"/>
133                 <replace file="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/7.2.5/pax-web-features-7.2.5-features.xml"
134                     token="org.apache.aries/org.apache.aries.util/1.1.0" value="org.apache.aries/org.apache.aries.util/1.1.3" failOnNoReplacements="true"/>
135                 <!-- Keep consistency with standard-features.xml -->
136                 <replace file="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/7.2.5/pax-web-features-7.2.5-features.xml"
137                          token="org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.0.10" value="org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.2" failOnNoReplacements="true"/>
138                 <copy file="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/7.2.5/pax-web-features-7.2.5-features.xml"
139                       tofile="${project.build.directory}/classes/system/org/ops4j/pax/web/pax-web-features/7.2.5/pax-web-features-7.2.5-features.xml"/>
140                 <!-- Add startup bundles to startup.properties — order is significant, bundles are wired in declaration order -->
141                 <echo file="${project.build.directory}/assembly/etc/startup.properties" append="true">
142 # The following are added by opendaylight-karaf-resources
143 mvn\:org.osgi/org.osgi.service.event/1.3.1 = 7
144 mvn\:org.apache.felix/org.apache.felix.metatype/1.2.2 = 8
145 mvn\:org.opendaylight.odlparent/bcprov-framework-ext/${project.version} = 14
146 mvn\:org.opendaylight.odlparent/bcpkix-framework-ext/${project.version} = 14
147 mvn\:org.apache.aries.blueprint/org.apache.aries.blueprint.core.compatibility/1.0.0 = 14
148                 </echo>
149                 <copy file="${project.build.directory}/assembly/etc/startup.properties"
150                       tofile="${project.build.directory}/classes/etc/startup.properties"/>
151                 <fixcrlf srcdir="${project.build.directory}/classes/bin"
152                          includes="*.bat" eol="crlf"/>
153               </target>
154             </configuration>
155           </execution>
156         </executions>
157       </plugin>
158       <plugin>
159         <groupId>org.apache.maven.plugins</groupId>
160         <artifactId>maven-dependency-plugin</artifactId>
161         <executions>
162           <execution>
163             <id>copy-framework-extensions</id>
164             <goals>
165               <goal>copy</goal>
166             </goals>
167             <phase>generate-resources</phase>
168             <configuration>
169               <artifactItems>
170                 <!-- Needs to be copied to lib/boot in order have it accessible to Main class -->
171                 <artifactItem>
172                     <groupId>org.bouncycastle</groupId>
173                     <artifactId>bcprov-ext-jdk15on</artifactId>
174                     <version>${bouncycastle.version}</version>
175                     <outputDirectory>target/classes/lib/boot</outputDirectory>
176                     <destFileName>bcprov-ext-jdk15on-${bouncycastle.version}.jar</destFileName>
177                 </artifactItem>
178                 <artifactItem>
179                     <groupId>org.bouncycastle</groupId>
180                     <artifactId>bcpkix-jdk15on</artifactId>
181                     <version>${bouncycastle.version}</version>
182                     <outputDirectory>target/classes/lib/boot</outputDirectory>
183                     <destFileName>bcpkix-jdk15on-${bouncycastle.version}.jar</destFileName>
184                 </artifactItem>
185               </artifactItems>
186               <silent>true</silent>
187             </configuration>
188           </execution>
189         </executions>
190       </plugin>
191       <plugin>
192         <groupId>org.codehaus.mojo</groupId>
193         <artifactId>build-helper-maven-plugin</artifactId>
194         <executions>
195           <execution>
196             <id>attach-artifacts</id>
197             <goals>
198               <goal>attach-artifact</goal>
199             </goals>
200             <phase>package</phase>
201             <configuration>
202               <artifacts>
203                 <artifact>
204                   <file>src/main/assembly/etc/org.ops4j.pax.url.mvn.cfg</file>
205                   <type>properties</type>
206                   <classifier>config</classifier>
207                 </artifact>
208               </artifacts>
209             </configuration>
210           </execution>
211         </executions>
212       </plugin>
213       <plugin>
214         <!-- We do this here only so that we can patch a few files,
215              but we then "throw away" (do not package) most of it,
216              as the karaf4-parent will do this again                -->
217         <groupId>org.apache.karaf.tooling</groupId>
218         <artifactId>karaf-maven-plugin</artifactId>
219         <version>${karaf.version}</version>
220         <executions>
221           <execution>
222             <id>process-resources</id>
223             <phase>process-resources</phase>
224             <goals>
225               <goal>assembly</goal>
226             </goals>
227           </execution>
228       </executions>
229       </plugin>
230       <!-- This needs to execute before patching, otherwise the feature will be left unpatched -->
231       <plugin>
232         <groupId>org.opendaylight.odlparent</groupId>
233         <artifactId>karaf-plugin</artifactId>
234         <version>6.0.2-SNAPSHOT</version>
235         <executions>
236           <execution>
237             <id>populate-local-repo</id>
238             <phase>prepare-package</phase>
239             <goals>
240               <goal>populate-local-repo</goal>
241             </goals>
242             <configuration>
243               <localRepo>${project.build.directory}/assembly/system</localRepo>
244             </configuration>
245           </execution>
246         </executions>
247       </plugin>
248     </plugins>
249   </build>
250 </project>