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