Fix duplicate commons-lang3 version
[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>13.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     <!-- jacoco:report bombs out on BouncyCastle's JDK15 classes, it has not point anyway -->
28     <jacoco.skip>true</jacoco.skip>
29   </properties>
30   <dependencies>
31     <dependency>
32       <groupId>org.apache.karaf.features</groupId>
33       <artifactId>framework</artifactId>
34       <version>${karaf.version}</version>
35       <type>kar</type>
36     </dependency>
37     <dependency>
38       <groupId>org.apache.karaf.features</groupId>
39       <artifactId>standard</artifactId>
40       <version>${karaf.version}</version>
41       <classifier>features</classifier>
42       <type>xml</type>
43       <scope>runtime</scope>
44     </dependency>
45
46     <!-- BouncyCastle Framework Extension Bundles -->
47     <dependency>
48       <groupId>org.opendaylight.odlparent</groupId>
49       <artifactId>bcpkix-framework-ext</artifactId>
50       <scope>runtime</scope>
51     </dependency>
52     <dependency>
53       <groupId>org.opendaylight.odlparent</groupId>
54       <artifactId>bcprov-framework-ext</artifactId>
55       <scope>runtime</scope>
56     </dependency>
57     <dependency>
58       <groupId>org.opendaylight.odlparent</groupId>
59       <artifactId>bcutil-framework-ext</artifactId>
60       <scope>runtime</scope>
61     </dependency>
62
63     <!-- SLF4J logging markers -->
64     <dependency>
65       <groupId>org.opendaylight.odlparent</groupId>
66       <artifactId>logging-markers</artifactId>
67       <scope>runtime</scope>
68     </dependency>
69   </dependencies>
70
71   <build>
72     <resources>
73       <resource>
74         <directory>src/main/resources</directory>
75         <filtering>false</filtering>
76       </resource>
77     </resources>
78     <plugins>
79       <plugin>
80         <artifactId>maven-antrun-plugin</artifactId>
81         <executions>
82           <execution>
83             <id>patch-karaf-scripts</id>
84             <phase>prepare-package</phase>
85             <goals>
86               <goal>run</goal>
87             </goals>
88             <configuration>
89               <target>
90                 <!-- Patches only work with LF line endings from ant -->
91                 <fixcrlf srcdir="${project.build.directory}/assembly/bin"
92                          includes="*.bat" eol="lf"/>
93                 <patch patchfile="${project.basedir}/src/main/patches/karaf-instance.patch"
94                        originalfile="${project.build.directory}/assembly/bin/instance"
95                        failonerror="true"/>
96                 <copy file="${project.build.directory}/assembly/bin/instance"
97                       tofile="${project.build.directory}/classes/bin/instance"/>
98                 <patch patchfile="${project.basedir}/src/main/patches/karaf-instance.bat.patch"
99                        originalfile="${project.build.directory}/assembly/bin/instance.bat"
100                        failonerror="true" ignorewhitespace="true"/>
101                 <copy file="${project.build.directory}/assembly/bin/instance.bat"
102                       tofile="${project.build.directory}/classes/bin/instance.bat"/>
103                 <patch patchfile="${project.basedir}/src/main/patches/karaf-inc.patch"
104                        originalfile="${project.build.directory}/assembly/bin/inc"
105                        failonerror="true"/>
106                 <copy file="${project.build.directory}/assembly/bin/inc"
107                       tofile="${project.build.directory}/classes/bin/inc"/>
108                 <patch patchfile="${project.basedir}/src/main/patches/karaf-karaf.patch"
109                        originalfile="${project.build.directory}/assembly/bin/karaf"
110                        failonerror="true"/>
111                 <copy file="${project.build.directory}/assembly/bin/karaf"
112                       tofile="${project.build.directory}/classes/bin/karaf"/>
113                 <patch patchfile="${project.basedir}/src/main/patches/karaf-karaf.bat.patch"
114                        originalfile="${project.build.directory}/assembly/bin/karaf.bat"
115                        failonerror="true"/>
116                 <copy file="${project.build.directory}/assembly/bin/karaf.bat"
117                       tofile="${project.build.directory}/classes/bin/karaf.bat"/>
118                 <!-- FIXME: ODLPARENT-298: remove this instruction -->
119                 <patch patchfile="${project.basedir}/src/main/patches/karaf-quiesce.patch"
120                        originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
121                        failonerror="true"/>
122                 <patch patchfile="${project.basedir}/src/main/patches/karaf-remove-bc.patch"
123                        originalfile="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
124                        failonerror="true"/>
125                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
126                       token="commons-io/commons-io/2.13.0" value="commons-io/commons-io/2.15.1" failOnNoReplacements="true"/>
127                 <replace file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
128                       token="org.apache.commons/commons-lang3/3.13.0" value="org.apache.commons/commons-lang3/3.14.0" failOnNoReplacements="true"/>
129                 <copy file="${project.build.directory}/assembly/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"
130                       tofile="${project.build.directory}/classes/system/org/apache/karaf/features/standard/${karaf.version}/standard-${karaf.version}-features.xml"/>
131                 <copy file="${project.build.directory}/assembly/system/org/apache/karaf/features/framework/${karaf.version}/framework-${karaf.version}-features.xml"
132                       tofile="${project.build.directory}/classes/system/org/apache/karaf/features/framework/${karaf.version}/framework-${karaf.version}-features.xml"/>
133                 <replace file="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/8.0.22/pax-web-features-8.0.22-features.xml"
134                       token="/2.15.2" value="/2.15.3" failOnNoReplacements="true"/>
135                 <copy file="${project.build.directory}/assembly/system/org/ops4j/pax/web/pax-web-features/8.0.22/pax-web-features-8.0.22-features.xml"
136                       tofile="${project.build.directory}/classes/system/org/ops4j/pax/web/pax-web-features/8.0.22/pax-web-features-8.0.22-features.xml"/>
137                 <!-- Add startup bundles to startup.properties — order is significant, bundles are wired in declaration order -->
138                 <echo file="${project.build.directory}/assembly/etc/startup.properties" append="true">
139 # The following are added by opendaylight-karaf-resources
140 mvn\:org.osgi/org.osgi.service.event/1.4.1 = 7
141 mvn\:org.apache.felix/org.apache.felix.metatype/1.2.4 = 8
142 mvn\:org.opendaylight.odlparent/bcprov-framework-ext/${project.version} = 14
143 mvn\:org.opendaylight.odlparent/bcutil-framework-ext/${project.version} = 14
144 mvn\:org.opendaylight.odlparent/bcpkix-framework-ext/${project.version} = 14
145 mvn\:org.opendaylight.odlparent/logging-markers/${project.version} = 14
146 # NOTE: this entry will be removed by https://jira.opendaylight.org/browse/ODLPARENT-297
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                 <replace file="${project.build.directory}/assembly/etc/users.properties"
152                          token="#karaf" value="karaf" failOnNoReplacements="true"/>
153                 <replace file="${project.build.directory}/assembly/etc/users.properties"
154                          token="#_g_" value="_g_" failOnNoReplacements="true"/>
155                 <copy file="${project.build.directory}/assembly/etc/users.properties"
156                       tofile="${project.build.directory}/classes/etc/users.properties"/>
157                 <fixcrlf srcdir="${project.build.directory}/classes/bin"
158                          includes="*.bat" eol="crlf"/>
159               </target>
160             </configuration>
161           </execution>
162         </executions>
163       </plugin>
164       <plugin>
165         <groupId>org.apache.maven.plugins</groupId>
166         <artifactId>maven-dependency-plugin</artifactId>
167         <executions>
168           <execution>
169             <id>copy-framework-extensions</id>
170             <goals>
171               <goal>copy</goal>
172             </goals>
173             <phase>generate-resources</phase>
174             <configuration>
175               <artifactItems>
176                 <!-- Needs to be copied to lib/boot in order have it accessible to Main class -->
177                 <artifactItem>
178                     <groupId>org.bouncycastle</groupId>
179                     <artifactId>bcprov-ext-jdk18on</artifactId>
180                     <version>${bouncycastle.version}</version>
181                     <outputDirectory>target/classes/lib/boot</outputDirectory>
182                     <destFileName>bcprov-ext-jdk18on-${bouncycastle.version}.jar</destFileName>
183                 </artifactItem>
184                 <artifactItem>
185                     <groupId>org.bouncycastle</groupId>
186                     <artifactId>bcpkix-jdk18on</artifactId>
187                     <version>${bouncycastle.version}</version>
188                     <outputDirectory>target/classes/lib/boot</outputDirectory>
189                     <destFileName>bcpkix-jdk18on-${bouncycastle.version}.jar</destFileName>
190                 </artifactItem>
191                 <artifactItem>
192                     <groupId>org.bouncycastle</groupId>
193                     <artifactId>bcutil-jdk18on</artifactId>
194                     <version>${bouncycastle.version}</version>
195                     <outputDirectory>target/classes/lib/boot</outputDirectory>
196                     <destFileName>bcutil-jdk18on-${bouncycastle.version}.jar</destFileName>
197                 </artifactItem>
198               </artifactItems>
199               <silent>true</silent>
200             </configuration>
201           </execution>
202         </executions>
203       </plugin>
204       <plugin>
205         <groupId>org.codehaus.mojo</groupId>
206         <artifactId>build-helper-maven-plugin</artifactId>
207         <executions>
208           <execution>
209             <id>attach-artifacts</id>
210             <goals>
211               <goal>attach-artifact</goal>
212             </goals>
213             <phase>package</phase>
214             <configuration>
215               <artifacts>
216                 <artifact>
217                   <file>src/main/assembly/etc/org.ops4j.pax.url.mvn.cfg</file>
218                   <type>properties</type>
219                   <classifier>config</classifier>
220                 </artifact>
221               </artifacts>
222             </configuration>
223           </execution>
224         </executions>
225       </plugin>
226       <plugin>
227         <!-- We do this here only so that we can patch a few files,
228              but we then "throw away" (do not package) most of it,
229              as the karaf4-parent will do this again                -->
230         <groupId>org.apache.karaf.tooling</groupId>
231         <artifactId>karaf-maven-plugin</artifactId>
232         <version>${karaf.version}</version>
233         <executions>
234           <execution>
235             <id>process-resources</id>
236             <phase>process-resources</phase>
237             <goals>
238               <goal>assembly</goal>
239             </goals>
240           </execution>
241       </executions>
242       </plugin>
243       <!-- This needs to execute before patching, otherwise the feature will be left unpatched -->
244       <plugin>
245         <groupId>org.opendaylight.odlparent</groupId>
246         <artifactId>karaf-plugin</artifactId>
247         <version>13.0.10-SNAPSHOT</version>
248         <executions>
249           <execution>
250             <id>populate-local-repo</id>
251             <phase>prepare-package</phase>
252             <goals>
253               <goal>populate-local-repo</goal>
254             </goals>
255             <configuration>
256               <localRepo>${project.build.directory}/assembly/system</localRepo>
257             </configuration>
258           </execution>
259         </executions>
260       </plugin>
261     </plugins>
262   </build>
263 </project>