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