Merge "Use dependencies plugin"
[ccsdk/distribution.git] / odlsli / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4     <modelVersion>4.0.0</modelVersion>
5
6     <parent>
7         <groupId>org.onap.ccsdk.parent</groupId>
8         <artifactId>odlparent-lite</artifactId>
9         <version>1.0.1-SNAPSHOT</version>
10         <relativePath />
11     </parent>
12
13     <artifactId>distribution-odlsli</artifactId>
14     <version>0.2.1-SNAPSHOT</version>
15     <packaging>pom</packaging>
16
17     <name>ccsdk-distribution :: odlsli</name>
18     <description>Creates SDN Controller Docker container</description>
19     <organization>
20         <name>openECOMP</name>
21     </organization>
22
23     <properties>
24         <image.name>onap/ccsdk-odlsli-image</image.name>
25         <ccsdk.project.version>${project.version}</ccsdk.project.version>
26         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
27     </properties>
28
29     <dependencies>
30
31         <dependency>
32             <groupId>org.onap.ccsdk.sli.core</groupId>
33             <artifactId>dblib-installer</artifactId>
34             <version>${ccsdk.sli.core.version}</version>
35             <type>zip</type>
36         </dependency>
37         <dependency>
38             <groupId>org.onap.ccsdk.sli.core</groupId>
39             <artifactId>filters-installer</artifactId>
40             <version>${ccsdk.sli.core.version}</version>
41             <type>zip</type>
42         </dependency>
43         <dependency>
44             <groupId>org.onap.ccsdk.sli.core</groupId>
45             <artifactId>sli-installer</artifactId>
46             <version>${ccsdk.sli.core.version}</version>
47             <type>zip</type>
48         </dependency>
49         <dependency>
50             <groupId>org.onap.ccsdk.sli.core</groupId>
51             <artifactId>sliapi-installer</artifactId>
52             <version>${ccsdk.sli.core.version}</version>
53             <type>zip</type>
54         </dependency>
55         <dependency>
56             <groupId>org.onap.ccsdk.sli.core</groupId>
57             <artifactId>sliPluginUtils-installer</artifactId>
58             <version>${ccsdk.sli.core.version}</version>
59             <type>zip</type>
60         </dependency>
61         <dependency>
62             <groupId>org.onap.ccsdk.sli.core</groupId>
63             <artifactId>utils-installer</artifactId>
64             <version>${ccsdk.sli.core.version}</version>
65             <type>zip</type>
66         </dependency>
67         <dependency>
68             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
69             <artifactId>aai-service-installer</artifactId>
70             <version>${ccsdk.sli.adaptors.version}</version>
71             <type>zip</type>
72         </dependency>
73         <dependency>
74             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
75             <artifactId>mdsal-resource-installer</artifactId>
76             <version>${ccsdk.sli.adaptors.version}</version>
77             <type>zip</type>
78         </dependency>
79         <dependency>
80             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
81             <artifactId>resource-assignment-installer</artifactId>
82             <version>${ccsdk.sli.adaptors.version}</version>
83             <type>zip</type>
84         </dependency>
85         <dependency>
86             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
87             <artifactId>sql-resource-installer</artifactId>
88             <version>${ccsdk.sli.adaptors.version}</version>
89             <type>zip</type>
90         </dependency>
91         <dependency>
92             <groupId>org.onap.ccsdk.sli.northbound</groupId>
93             <artifactId>asdcApi-installer</artifactId>
94             <version>${ccsdk.sli.northbound.version}</version>
95             <type>zip</type>
96         </dependency>
97         <dependency>
98             <groupId>org.onap.ccsdk.sli.northbound</groupId>
99             <artifactId>dataChange-installer</artifactId>
100             <version>${ccsdk.sli.northbound.version}</version>
101             <type>zip</type>
102         </dependency>
103         <dependency>
104             <groupId>org.onap.ccsdk.sli.plugins</groupId>
105             <artifactId>properties-node-installer</artifactId>
106             <version>${ccsdk.sli.plugins.version}</version>
107             <type>zip</type>
108         </dependency>
109         <dependency>
110             <groupId>org.onap.ccsdk.sli.plugins</groupId>
111             <artifactId>restapi-call-node-installer</artifactId>
112             <version>${ccsdk.sli.plugins.version}</version>
113             <type>zip</type>
114         </dependency>
115     </dependencies>
116
117     <build>
118         <plugins>
119
120
121             <plugin>
122                 <groupId>org.codehaus.groovy.maven</groupId>
123                 <artifactId>gmaven-plugin</artifactId>
124                 <executions>
125                     <execution>
126                         <phase>validate</phase>
127                         <goals>
128                             <goal>execute</goal>
129                         </goals>
130                         <configuration>
131                             <source>
132                                 println project.properties['ccsdk.project.version'];
133                                 def versionArray;
134                                 if (project.properties['ccsdk.project.version'] != null ) {
135                                     versionArray = project.properties['ccsdk.project.version'].split('\\.');
136                                 }
137
138                                 if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) {
139                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
140                                 } else {
141                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
142                                 }
143
144                                 println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
145                             </source>
146                         </configuration>
147                     </execution>
148                 </executions>
149             </plugin>
150
151
152
153             <plugin>
154                 <artifactId>maven-resources-plugin</artifactId>
155                 <version>2.6</version>
156                 <executions>
157                     <execution>
158                         <id>copy-dockerfile</id>
159                         <goals>
160                             <goal>copy-resources</goal>
161                         </goals><!-- here the phase you need -->
162                         <phase>validate</phase>
163                         <configuration>
164                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
165                             <resources>
166                                 <resource>
167                                     <directory>src/main/docker</directory>
168                                     <includes>
169                                         <include>Dockerfile</include>
170                                     </includes>
171                                     <filtering>true</filtering>
172                                 </resource>
173                             </resources>
174                         </configuration>
175                     </execution>
176
177                     <execution>
178                         <id>copy-scripts</id>
179                         <goals>
180                             <goal>copy-resources</goal>
181                         </goals><!-- here the phase you need -->
182                         <phase>validate</phase>
183                         <configuration>
184                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/bin</outputDirectory>
185                             <resources>
186                                 <resource>
187                                     <directory>src/main/scripts</directory>
188                                     <includes>
189                                         <include>*.sh</include>
190                                     </includes>
191                                     <filtering>false</filtering>
192                                 </resource>
193                             </resources>
194                         </configuration>
195                     </execution>
196
197                     <execution>
198                         <id>copy-tarballs</id>
199                         <goals>
200                             <goal>copy-resources</goal>
201                         </goals><!-- here the phase you need -->
202                         <phase>validate</phase>
203                         <configuration>
204                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
205                             <resources>
206                                 <resource>
207                                     <directory>src/main/resources</directory>
208                                     <includes>
209                                         <include>idmlight.db.mv.db</include>
210                                     </includes>
211                                     <filtering>false</filtering>
212                                 </resource>
213                             </resources>
214                         </configuration>
215                     </execution>
216                     <execution>
217                         <id>copy-config</id>
218                         <goals>
219                             <goal>copy-resources</goal>
220                         </goals><!-- here the phase you need -->
221                         <phase>validate</phase>
222                         <configuration>
223                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
224                             <resources>
225                                 <resource>
226                                     <directory>src/main/resources</directory>
227                                     <includes>
228                                         <include>org.ops4j.pax.logging.cfg</include>
229                                     </includes>
230                                     <filtering>false</filtering>
231                                 </resource>
232                             </resources>
233                         </configuration>
234                     </execution>
235                     <execution>
236                         <id>copy-data</id>
237                         <goals>
238                             <goal>copy-resources</goal>
239                         </goals><!-- here the phase you need -->
240                         <phase>validate</phase>
241                         <configuration>
242                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/data</outputDirectory>
243                             <resources>
244                                 <resource>
245                                     <directory>src/main/resources</directory>
246                                     <includes>
247                                         <include>*.dump</include>
248                                     </includes>
249                                     <filtering>false</filtering>
250                                 </resource>
251                             </resources>
252                         </configuration>
253                     </execution>
254                     <execution>
255                         <id>copy-properties</id>
256                         <goals>
257                             <goal>copy-resources</goal>
258                         </goals><!-- here the phase you need -->
259                         <phase>validate</phase>
260                         <configuration>
261                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/data/properties</outputDirectory>
262                             <resources>
263                                 <resource>
264                                     <directory>src/main/properties</directory>
265                                     <includes>
266                                         <include>*.properties</include>
267                                     </includes>
268                                     <filtering>false</filtering>
269                                 </resource>
270                             </resources>
271                         </configuration>
272                     </execution>
273                     <execution>
274                         <id>copy-keystores</id>
275                         <goals>
276                             <goal>copy-resources</goal>
277                         </goals><!-- here the phase you need -->
278                         <phase>validate</phase>
279                         <configuration>
280                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/data/stores</outputDirectory>
281                             <resources>
282                                 <resource>
283                                     <directory>src/main/stores</directory>
284                                     <includes>
285                                         <include>*.jks</include>
286                                     </includes>
287                                     <filtering>false</filtering>
288                                 </resource>
289                             </resources>
290                         </configuration>
291                     </execution>
292                 </executions>
293             </plugin>
294             <plugin>
295                 <groupId>org.apache.maven.plugins</groupId>
296                 <artifactId>maven-dependency-plugin</artifactId>
297                 <version>3.0.2</version>
298                 <executions>
299                     <execution>
300                         <id>unpack features</id>
301                         <phase>generate-sources</phase>
302                         <goals>
303                         <goal>unpack-dependencies</goal>
304                         </goals>
305                         <configuration>
306                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/features</outputDirectory>
307                             <excludeTransitive>true</excludeTransitive>
308                         </configuration>
309                     </execution>
310                 </executions>
311             </plugin>
312             <plugin>
313                 <groupId>org.codehaus.mojo</groupId>
314                 <artifactId>exec-maven-plugin</artifactId>
315                 <version>1.5.0</version>
316                 <executions>
317
318 <!--                     <execution>
319                         <id>Get features</id>
320                         <phase>generate-sources</phase>
321                         <goals>
322                             <goal>exec</goal>
323                         </goals>
324                         <configuration>
325                             <executable>/bin/bash</executable>
326                             <environmentVariables>
327                                 <SDNC_CORE_VERSION>${ccsdk.sli.core.version}</SDNC_CORE_VERSION>
328                                 <SDNC_ADAPTORS_VERSION>${ccsdk.sli.adaptors.version}</SDNC_ADAPTORS_VERSION>
329                                 <SDNC_NORTHBOUND_VERSION>${ccsdk.sli.northbound.version}</SDNC_NORTHBOUND_VERSION>
330                                 <SDNC_PLUGINS_VERSION>${ccsdk.sli.plugins.version}</SDNC_PLUGINS_VERSION>
331                                 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
332                             </environmentVariables>
333                             <arguments>
334                                 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
335                                 <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
336                             </arguments>
337                         </configuration>
338                     </execution> -->
339
340                     <execution>
341                         <id>change shell permissions</id>
342                         <phase>process-sources</phase>
343                         <goals>
344                             <goal>exec</goal>
345                         </goals>
346                         <configuration>
347                             <executable>/usr/bin/find</executable>
348                             <arguments>
349                                 <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
350                                 <argument>-name</argument>
351                                 <argument>*.sh</argument>
352                                 <argument>-exec</argument>
353                                 <argument>chmod</argument>
354                                 <argument>+x</argument>
355                                 <argument>{}</argument>
356                                 <argument>;</argument>
357                             </arguments>
358                         </configuration>
359                     </execution>
360                 </executions>
361             </plugin>
362
363
364         </plugins>
365     </build>
366
367     <profiles>
368         <profile>
369             <id>docker</id>
370             <build>
371                 <plugins>
372                     <plugin>
373                         <groupId>io.fabric8</groupId>
374                         <artifactId>docker-maven-plugin</artifactId>
375                         <version>0.16.5</version>
376                         <inherited>false</inherited>
377                         <configuration>
378                             <images>
379                                 <image>
380                                     <name>${image.name}</name>
381                                     <build>
382                                         <cleanup>try</cleanup>
383                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
384                                         <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
385                                         <tags>
386                                             <tag>${project.version}</tag>
387                                             <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
388                                             <tag>${project.docker.latesttag.version}</tag>
389                                         </tags>
390                                     </build>
391                                 </image>
392                             </images>
393                         </configuration>
394                         <executions>
395                             <execution>
396                                 <id>generate-images</id>
397                                 <phase>package</phase>
398                                 <goals>
399                                     <goal>build</goal>
400                                 </goals>
401                             </execution>
402
403                             <execution>
404                                 <id>push-images</id>
405                                 <phase>deploy</phase>
406                                 <goals>
407                                     <goal>build</goal>
408                                     <goal>push</goal>
409                                 </goals>
410                             </execution>
411                         </executions>
412                     </plugin>
413                 </plugins>
414             </build>
415         </profile>
416     </profiles>
417 </project>