Add a fix for KARAF-5086
[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>4.0.10-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   </dependencies>
44
45   <build>
46     <resources>
47       <resource>
48         <directory>src/main/resources</directory>
49         <filtering>false</filtering>
50       </resource>
51     </resources>
52     <plugins>
53       <plugin>
54         <artifactId>maven-antrun-plugin</artifactId>
55         <executions>
56           <execution>
57             <id>patch-karaf-scripts</id>
58             <phase>prepare-package</phase>
59             <goals>
60               <goal>run</goal>
61             </goals>
62             <configuration>
63               <target>
64                 <!-- Patches only work with LF line endings from ant -->
65                 <fixcrlf srcdir="${project.build.directory}/assembly/bin"
66                          includes="*.bat" eol="lf"/>
67                 <patch patchfile="${project.basedir}/src/main/patches/karaf-instance.patch"
68                        originalfile="${project.build.directory}/assembly/bin/instance"
69                        failonerror="true"/>
70                 <copy file="${project.build.directory}/assembly/bin/instance"
71                       tofile="${project.build.directory}/classes/bin/instance"/>
72                 <patch patchfile="${project.basedir}/src/main/patches/karaf-instance.bat.patch"
73                        originalfile="${project.build.directory}/assembly/bin/instance.bat"
74                        failonerror="true" ignorewhitespace="true"/>
75                 <copy file="${project.build.directory}/assembly/bin/instance.bat"
76                       tofile="${project.build.directory}/classes/bin/instance.bat"/>
77                 <patch patchfile="${project.basedir}/src/main/patches/karaf-inc-${karaf.version}.patch"
78                        originalfile="${project.build.directory}/assembly/bin/inc"
79                        failonerror="true"/>
80                 <copy file="${project.build.directory}/assembly/bin/inc"
81                       tofile="${project.build.directory}/classes/bin/inc"/>
82                 <patch patchfile="${project.basedir}/src/main/patches/karaf-karaf-${karaf.version}.patch"
83                        originalfile="${project.build.directory}/assembly/bin/karaf"
84                        failonerror="true"/>
85                 <copy file="${project.build.directory}/assembly/bin/karaf"
86                       tofile="${project.build.directory}/classes/bin/karaf"/>
87                 <patch patchfile="${project.basedir}/src/main/patches/karaf-karaf.bat.patch"
88                        originalfile="${project.build.directory}/assembly/bin/karaf.bat"
89                        failonerror="true"/>
90                 <copy file="${project.build.directory}/assembly/bin/karaf.bat"
91                       tofile="${project.build.directory}/classes/bin/karaf.bat"/>
92                 <patch patchfile="${project.basedir}/src/main/patches/karaf-setenv-${karaf.version}.patch"
93                        originalfile="${project.build.directory}/assembly/bin/setenv"
94                        failonerror="true"/>
95                 <copy file="${project.build.directory}/assembly/bin/setenv"
96                       tofile="${project.build.directory}/classes/bin/setenv"/>
97                 <patch patchfile="${project.basedir}/src/main/patches/karaf-setenv.bat.patch"
98                        originalfile="${project.build.directory}/assembly/bin/setenv.bat"
99                        failonerror="true"/>
100                 <copy file="${project.build.directory}/assembly/bin/setenv.bat"
101                       tofile="${project.build.directory}/classes/bin/setenv.bat"/>
102                 <patch patchfile="${project.basedir}/src/main/patches/karaf-quiesce-${karaf.version}.patch"
103                        originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
104                        failonerror="true"/>
105                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
106                          token="commons-codec/commons-codec/1.10" value="commons-codec/commons-codec/1.12" failOnNoReplacements="true"/>
107                 <!-- fixes https://issues.apache.org/jira/browse/KARAF-5086 -->
108                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
109                          token="org.apache.aries.proxy/org.apache.aries.proxy/1.1.3" value="org.apache.aries.proxy/org.apache.aries.proxy/1.1.4" failOnNoReplacements="true"/>
110                 <copy file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
111                       tofile="${project.build.directory}/classes/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"/>
112                 <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"
113                          token="commons-beanutils/commons-beanutils/1.8.3" value="commons-beanutils/commons-beanutils/1.9.3" failOnNoReplacements="true"/>
114                 <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"
115                          token="commons-codec/commons-codec/1.8" value="commons-codec/commons-codec/1.12" failOnNoReplacements="true"/>
116                 <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"
117                          token="javax.mail/mail/1.4.4" value="javax.mail/mail/1.4.7" failOnNoReplacements="true"/>
118                 <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"
119                          token="org.apache.aries/org.apache.aries.util/1.1.0" value="org.apache.aries/org.apache.aries.util/1.1.3" failOnNoReplacements="true"/>
120                 <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"
121                       tofile="${project.build.directory}/classes/system/org/ops4j/pax/web/pax-web-features/7.2.5/pax-web-features-7.2.5-features.xml"/>
122                 <!-- Add startup bundles to startup.properties — order is significant, bundles are wired in declaration order -->
123                 <echo file="${project.build.directory}/assembly/etc/startup.properties" append="true">
124 # The following are added by opendaylight-karaf-resources
125 mvn\:org.osgi/org.osgi.service.event/1.3.1 = 7
126 mvn\:org.apache.felix/org.apache.felix.metatype/1.2.2 = 8
127 mvn\:org.opendaylight.odlparent/bcprov-framework-ext/${project.version} = 14
128 mvn\:org.opendaylight.odlparent/bcpkix-framework-ext/${project.version} = 14
129 mvn\:org.apache.aries.blueprint/org.apache.aries.blueprint.core.compatibility/1.0.0 = 14
130                 </echo>
131                 <copy file="${project.build.directory}/assembly/etc/startup.properties"
132                       tofile="${project.build.directory}/classes/etc/startup.properties"/>
133                 <fixcrlf srcdir="${project.build.directory}/classes/bin"
134                          includes="*.bat" eol="crlf"/>
135               </target>
136             </configuration>
137           </execution>
138         </executions>
139       </plugin>
140       <plugin>
141         <groupId>org.apache.maven.plugins</groupId>
142         <artifactId>maven-dependency-plugin</artifactId>
143         <executions>
144           <execution>
145             <id>copy</id>
146             <goals>
147               <goal>copy</goal>
148             </goals>
149             <phase>generate-resources</phase>
150             <configuration>
151               <artifactItems>
152                 <!-- Needs to be copied to lib/boot in order have it accessible to Main class -->
153                 <artifactItem>
154                     <groupId>org.bouncycastle</groupId>
155                     <artifactId>bcprov-ext-jdk15on</artifactId>
156                     <version>${bouncycastle.version}</version>
157                     <outputDirectory>target/classes/lib/boot</outputDirectory>
158                     <destFileName>bcprov-ext-jdk15on-${bouncycastle.version}.jar</destFileName>
159                 </artifactItem>
160                 <artifactItem>
161                     <groupId>org.bouncycastle</groupId>
162                     <artifactId>bcpkix-jdk15on</artifactId>
163                     <version>${bouncycastle.version}</version>
164                     <outputDirectory>target/classes/lib/boot</outputDirectory>
165                     <destFileName>bcpkix-jdk15on-${bouncycastle.version}.jar</destFileName>
166                 </artifactItem>
167               </artifactItems>
168             </configuration>
169           </execution>
170         </executions>
171       </plugin>
172       <plugin>
173         <groupId>org.codehaus.mojo</groupId>
174         <artifactId>build-helper-maven-plugin</artifactId>
175         <executions>
176           <execution>
177             <id>attach-artifacts</id>
178             <goals>
179               <goal>attach-artifact</goal>
180             </goals>
181             <phase>package</phase>
182             <configuration>
183               <artifacts>
184                 <artifact>
185                   <file>src/main/assembly/etc/org.ops4j.pax.url.mvn.cfg</file>
186                   <type>properties</type>
187                   <classifier>config</classifier>
188                 </artifact>
189               </artifacts>
190             </configuration>
191           </execution>
192         </executions>
193       </plugin>
194       <plugin>
195         <!-- We do this here only so that we can patch a few files,
196              but we then "throw away" (do not package) most of it,
197              as the karaf4-parent will do this again                -->
198         <groupId>org.apache.karaf.tooling</groupId>
199         <artifactId>karaf-maven-plugin</artifactId>
200         <version>${karaf.version}</version>
201         <executions>
202           <execution>
203             <id>process-resources</id>
204             <phase>process-resources</phase>
205             <goals>
206               <goal>assembly</goal>
207             </goals>
208           </execution>
209       </executions>
210       </plugin>
211       <!-- This needs to execute before patching, otherwise the feature will be left unpatched -->
212       <plugin>
213         <groupId>org.opendaylight.odlparent</groupId>
214         <artifactId>karaf-plugin</artifactId>
215         <version>4.0.10-SNAPSHOT</version>
216         <executions>
217           <execution>
218             <id>populate-local-repo</id>
219             <phase>prepare-package</phase>
220             <goals>
221               <goal>populate-local-repo</goal>
222             </goals>
223             <configuration>
224               <localRepo>${project.build.directory}/assembly/system</localRepo>
225             </configuration>
226           </execution>
227         </executions>
228       </plugin>
229     </plugins>
230   </build>
231 </project>