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