6516993735d3e8cb87b97f698f6f879bcb626509
[ccsdk/apps.git] / ms / sliboot / 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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3     <modelVersion>4.0.0</modelVersion>
4
5     <parent>
6         <groupId>org.onap.ccsdk.apps</groupId>
7         <artifactId>ccsdk-apps-ms</artifactId>
8         <version>1.5.0-SNAPSHOT</version>
9     </parent>
10
11     <groupId>org.onap.ccsdk.apps</groupId>
12     <artifactId>sliboot</artifactId>
13     <version>1.5.0-SNAPSHOT</version>
14     <packaging>jar</packaging>
15
16     <name>ccsdk-apps :: sliboot :: ${project.artifactId}</name>
17
18     <properties>
19         <start-class>org.onap.ccsdk.apps.ms.sliboot.SlibootApp</start-class>
20         <aaf.cadi.version>2.1.21</aaf.cadi.version>
21         <base.image.name>onap/ccsdk-alpine-j11-image</base.image.name>
22         <base.image.version>1.2.2</base.image.version>
23         <image.name>onap/ccsdk-sliboot-alpine-image</image.name>
24         <ccsdk.project.version>${project.version}</ccsdk.project.version>
25         <ccsdk.distribution.version>1.2.2</ccsdk.distribution.version>
26         <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
27         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
28         <ccsdk.sliboot.jar>${project.artifactId}-${project.version}-exec.jar</ccsdk.sliboot.jar>
29         <docker.push.phase>deploy</docker.push.phase>
30         <docker.verbose>true</docker.verbose>
31         <docker.autoCreateCustomNetworks>true</docker.autoCreateCustomNetworks>
32         <java.home>/opt/java/openjdk</java.home>
33         <java.security.dir>${java.home}/lib/security</java.security.dir>
34     </properties>
35
36     <dependencies>
37         <dependency>
38             <groupId>io.swagger</groupId>
39             <artifactId>swagger-annotations</artifactId>
40         </dependency>
41         <dependency>
42             <groupId>org.springframework.boot</groupId>
43             <artifactId>spring-boot-starter-web</artifactId>
44             <exclusions>
45                 <exclusion>
46                     <groupId>org.springframework.boot</groupId>
47                     <artifactId>spring-boot-starter-logging</artifactId>
48                 </exclusion>
49             </exclusions>
50         </dependency>
51         <dependency>
52             <groupId>org.springframework.boot</groupId>
53             <artifactId>spring-boot-starter-log4j2</artifactId>
54         </dependency>
55         <dependency>
56             <groupId>org.springframework.boot</groupId>
57             <artifactId>spring-boot-starter-validation</artifactId>
58         </dependency>
59         <dependency>
60             <groupId>org.springframework.boot</groupId>
61             <artifactId>spring-boot-starter-test</artifactId>
62             <scope>test</scope>
63         </dependency>
64         <dependency>
65             <groupId>org.springframework.boot</groupId>
66             <artifactId>spring-boot-starter-data-jpa</artifactId>
67         </dependency>
68         <dependency>
69             <groupId>io.springfox</groupId>
70             <artifactId>springfox-boot-starter</artifactId>
71             <version>${springfox.version}</version>
72         </dependency>
73         <dependency>
74             <groupId>org.onap.aaf.authz</groupId>
75             <artifactId>aaf-cadi-client</artifactId>
76             <version>${aaf.cadi.version}</version>
77         </dependency>
78         <dependency>
79             <groupId>org.onap.aaf.authz</groupId>
80             <artifactId>aaf-cadi-core</artifactId>
81             <version>${aaf.cadi.version}</version>
82         </dependency>
83         <dependency>
84             <groupId>org.onap.aaf.authz</groupId>
85             <artifactId>aaf-auth-client</artifactId>
86             <version>${aaf.cadi.version}</version>
87             <scope>runtime</scope>
88         </dependency>
89         <dependency>
90             <groupId>org.onap.aaf.authz</groupId>
91             <artifactId>aaf-misc-env</artifactId>
92             <version>${aaf.cadi.version}</version>
93             <scope>runtime</scope>
94             <exclusions>
95                 <exclusion>
96                     <groupId>log4j</groupId>
97                     <artifactId>log4j</artifactId>
98                 </exclusion>
99             </exclusions>
100         </dependency>
101         <dependency>
102             <groupId>org.onap.aaf.authz</groupId>
103             <artifactId>aaf-misc-rosetta</artifactId>
104             <version>${aaf.cadi.version}</version>
105             <scope>runtime</scope>
106         </dependency>
107         <!-- Needed by logging-analytics payload logging filter -->
108         <dependency>
109             <groupId>org.apache.cxf</groupId>
110             <artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
111             <version>3.4.4</version>
112         </dependency>
113         <dependency>
114             <groupId>org.onap.aaf.authz</groupId>
115             <artifactId>aaf-cadi-client</artifactId>
116             <version>${aaf.cadi.version}</version>
117         </dependency>
118         <dependency>
119             <groupId>org.onap.aaf.authz</groupId>
120             <artifactId>aaf-cadi-core</artifactId>
121             <version>${aaf.cadi.version}</version>
122         </dependency>
123         <dependency>
124             <groupId>org.onap.aaf.authz</groupId>
125             <artifactId>aaf-auth-client</artifactId>
126             <version>${aaf.cadi.version}</version>
127             <scope>runtime</scope>
128         </dependency>
129         <dependency>
130             <groupId>org.onap.aaf.authz</groupId>
131             <artifactId>aaf-misc-env</artifactId>
132             <version>${aaf.cadi.version}</version>
133             <scope>runtime</scope>
134         </dependency>
135         <dependency>
136             <groupId>org.onap.aaf.authz</groupId>
137             <artifactId>aaf-misc-rosetta</artifactId>
138             <version>${aaf.cadi.version}</version>
139             <scope>runtime</scope>
140         </dependency>
141         <dependency>
142             <groupId>${project.groupId}</groupId>
143             <artifactId>services</artifactId>
144             <version>${project.version}</version>
145         </dependency>
146         <dependency>
147             <groupId>org.onap.ccsdk.sli.core</groupId>
148             <artifactId>dblib-provider</artifactId>
149             <version>${ccsdk.sli.core.version}</version>
150         </dependency>
151         <dependency>
152             <groupId>org.onap.ccsdk.sli.core</groupId>
153             <artifactId>sli-common</artifactId>
154             <version>${ccsdk.sli.core.version}</version>
155         </dependency>
156         <dependency>
157             <groupId>org.onap.ccsdk.sli.core</groupId>
158             <artifactId>sli-provider-base</artifactId>
159             <version>${ccsdk.sli.core.version}</version>
160         </dependency>
161         <dependency>
162             <groupId>org.onap.ccsdk.sli.core</groupId>
163             <artifactId>sliapi-model-swagger</artifactId>
164             <version>${ccsdk.sli.core.version}</version>
165             <type>yaml</type>
166         </dependency>
167         <dependency>
168             <groupId>org.onap.ccsdk.sli.core</groupId>
169             <artifactId>sliPluginUtils-provider</artifactId>
170             <version>${ccsdk.sli.core.version}</version>
171         </dependency>
172         <dependency>
173             <groupId>org.onap.ccsdk.sli.plugins</groupId>
174             <artifactId>restapi-call-node-provider</artifactId>
175             <version>${ccsdk.sli.plugins.version}</version>
176         </dependency>
177         <dependency>
178             <groupId>org.onap.ccsdk.sli.plugins</groupId>
179             <artifactId>properties-node-provider</artifactId>
180             <version>${ccsdk.sli.plugins.version}</version>
181         </dependency>
182         <dependency>
183             <groupId>org.onap.logging-analytics</groupId>
184             <artifactId>logging-filter-spring</artifactId>
185             <version>1.6.6</version>
186         </dependency>
187         <dependency>
188             <groupId>com.google.code.gson</groupId>
189             <artifactId>gson</artifactId>
190             <version>${gson.version}</version>
191         </dependency>
192         <dependency>
193             <groupId>org.apache.derby</groupId>
194             <artifactId>derby</artifactId>
195             <scope>test</scope>
196         </dependency>
197         <dependency>
198             <groupId>org.mariadb.jdbc</groupId>
199             <artifactId>mariadb-java-client</artifactId>
200         </dependency>
201         <dependency>
202             <groupId>junit</groupId>
203             <artifactId>junit</artifactId>
204             <scope>test</scope>
205         </dependency>
206         <dependency>
207             <groupId>javax.ws.rs</groupId>
208             <artifactId>javax.ws.rs-api</artifactId>
209         </dependency>
210         <!-- this jersey jar is needed for rest api call node to function properly -->
211         <dependency>
212             <groupId>org.glassfish.jersey.inject</groupId>
213             <artifactId>jersey-hk2</artifactId>
214         </dependency>
215     </dependencies>
216
217     <build>
218         <plugins>
219             <plugin>
220                 <groupId>org.codehaus.groovy.maven</groupId>
221                 <artifactId>gmaven-plugin</artifactId>
222                 <executions>
223                     <execution>
224                         <phase>validate</phase>
225                         <goals>
226                             <goal>execute</goal>
227                         </goals>
228                         <configuration>
229                             <source>${basedir}/TagVersion.groovy</source>
230                         </configuration>
231                     </execution>
232                 </executions>
233             </plugin>
234
235             <plugin>
236                 <groupId>org.apache.maven.plugins</groupId>
237                 <artifactId>maven-dependency-plugin</artifactId>
238                 <version>2.10</version>
239                 <executions>
240                     <execution>
241                         <id>copy-sliapi-model-swagger</id>
242                         <phase>initialize</phase>
243                         <goals>
244                             <goal>copy-dependencies</goal>
245                         </goals>
246                         <configuration>
247                             <outputDirectory>${project.build.directory}/yaml</outputDirectory>
248                             <useRepositoryLayout>false</useRepositoryLayout>
249                             <includeTypes>yaml</includeTypes>
250                             <stripVersion>true</stripVersion>
251                         </configuration>
252                     </execution>
253                     <execution>
254                         <id>copy-dependencies</id>
255                         <goals>
256                             <goal>copy-dependencies</goal>
257                         </goals>
258                         <phase>prepare-package</phase>
259                         <configuration>
260                             <excludeTransitive>true</excludeTransitive>
261                             <excludeTypes>yaml</excludeTypes>
262                             <outputDirectory>${project.build.directory}/docker-stage/opt/onap/ccsdk/lib</outputDirectory>
263                             <overWriteReleases>false</overWriteReleases>
264                             <overWriteSnapshots>true</overWriteSnapshots>
265                             <overWriteIfNewer>true</overWriteIfNewer>
266                             <useRepositoryLayout>false</useRepositoryLayout>
267                             <addParentPoms>false</addParentPoms>
268                             <copyPom>false</copyPom>
269                         </configuration>
270                     </execution>
271                     <execution>
272                         <id>unpack dgs</id>
273                         <phase>generate-sources</phase>
274                         <goals>
275                             <goal>unpack</goal>
276                         </goals>
277                         <configuration>
278                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk</outputDirectory>
279                             <artifactItems>
280                                 <artifactItem>
281                                     <groupId>org.onap.ccsdk.distribution</groupId>
282                                     <artifactId>platform-logic-installer</artifactId>
283                                     <version>${ccsdk.distribution.version}</version>
284                                     <type>zip</type>
285                                 </artifactItem>
286                             </artifactItems>
287                         </configuration>
288                     </execution>
289                 </executions>
290             </plugin>
291             <plugin>
292                 <groupId>io.swagger</groupId>
293                 <artifactId>swagger-codegen-maven-plugin</artifactId>
294                 <version>2.3.1</version>
295                 <executions>
296                     <execution>
297                         <phase>generate-sources</phase>
298                         <goals>
299                             <goal>generate</goal>
300                         </goals>
301                         <configuration>
302                             <output>target/generated-sources</output>
303                             <inputSpec>${project.build.directory}/yaml/sliapi-model-swagger.yaml</inputSpec>
304                             <language>spring</language>
305                             <apiPackage>org.onap.ccsdk.apps.ms.sliboot.swagger</apiPackage>
306                             <modelPackage>org.onap.ccsdk.apps.ms.sliboot.swagger.model</modelPackage>
307                             <invokerPackage>org.onap.ccsdk.apps.ms.sliboot.swagger</invokerPackage>
308                             <generateApis>true</generateApis>
309                             <generateApiTests>true</generateApiTests>
310                             <ignoreFileOverride>${project.basedir}/.swagger-codegen-ignore</ignoreFileOverride>
311                             <withXml>true</withXml>
312                             <templateDirectory>${project.basedir}/src/main/templates</templateDirectory>
313                             <configOptions>
314                                 <java8>true</java8>
315                                 <springBootVersion>2.2.4-RELEASE</springBootVersion>
316                             </configOptions>
317                         </configuration>
318                     </execution>
319                 </executions>
320             </plugin>
321             <plugin>
322                 <groupId>org.springframework.boot</groupId>
323                 <artifactId>spring-boot-maven-plugin</artifactId>
324                 <configuration>
325                     <classifier>exec</classifier>
326                 </configuration>
327                 <executions>
328                     <execution>
329                         <goals>
330                             <goal>repackage</goal>
331                         </goals>
332                     </execution>
333                 </executions>
334             </plugin>
335             <plugin>
336                 <groupId>org.apache.maven.plugins</groupId>
337                 <artifactId>maven-surefire-plugin</artifactId>
338                 <version>2.19.1</version>
339                 <configuration>
340                     <environmentVariables>
341                         <SDNC_CONFIG_DIR>${basedir}/src/test/resources</SDNC_CONFIG_DIR>
342                         <SVCLOGIC_PROPERTIES>${basedir}/src/test/resources/svclogic.properties</SVCLOGIC_PROPERTIES>
343                     </environmentVariables>
344                 </configuration>
345             </plugin>
346             <plugin>
347                 <groupId>org.apache.maven.plugins</groupId>
348                 <artifactId>maven-failsafe-plugin</artifactId>
349                 <executions>
350                     <execution>
351                         <goals>
352                             <goal>integration-test</goal>
353                             <goal>verify</goal>
354                         </goals>
355                     </execution>
356                 </executions>
357                 <configuration>
358                     <skipITs>true</skipITs>
359                 </configuration>
360             </plugin>
361             <plugin>
362                 <artifactId>maven-resources-plugin</artifactId>
363                 <version>2.6</version>
364                 <executions>
365                     <execution>
366                         <id>copy-dockerfile</id>
367                         <goals>
368                             <goal>copy-resources</goal>
369                         </goals><!-- here the phase you need -->
370                         <phase>initialize</phase>
371                         <configuration>
372                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
373                             <resources>
374                                 <resource>
375                                     <directory>src/main/docker</directory>
376                                     <includes>
377                                         <include>Dockerfile</include>
378                                     </includes>
379                                     <filtering>true</filtering>
380                                 </resource>
381                             </resources>
382                         </configuration>
383                     </execution>
384                     <execution>
385                         <id>copy-config</id>
386                         <goals>
387                             <goal>copy-resources</goal>
388                         </goals><!-- here the phase you need -->
389                         <phase>generate-resources</phase>
390                         <configuration>
391                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/config</outputDirectory>
392                             <resources>
393                                 <resource>
394                                     <directory>src/main/resources</directory>
395                                     <includes>
396                                         <include>*.properties</include>
397                                         <include>*.props</include>
398                                         <include>*.sql</include>
399                                     </includes>
400                                     <filtering>true</filtering>
401                                 </resource>
402                                 <resource>
403                                     <directory>src/main/resources</directory>
404                                     <includes>
405                                         <include>*.keyfile</include>
406                                         <include>*.jks</include>
407                                         <include>*.p12</include>
408                                     </includes>
409                                     <filtering>false</filtering>
410                                 </resource>
411                             </resources>
412                         </configuration>
413                     </execution>
414                     <execution>
415                         <id>copy-script</id>
416                         <goals>
417                             <goal>copy-resources</goal>
418                         </goals><!-- here the phase you need -->
419                         <phase>generate-resources</phase>
420                         <configuration>
421                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/bin</outputDirectory>
422                             <resources>
423                                 <resource>
424                                     <directory>src/main/resources</directory>
425                                     <includes>
426                                         <include>*.sh</include>
427                                     </includes>
428                                     <filtering>true</filtering>
429                                 </resource>
430                             </resources>
431                         </configuration>
432                     </execution>
433                     <execution>
434                         <id>copy-jar</id>
435                         <goals>
436                             <goal>copy-resources</goal>
437                         </goals><!-- here the phase you need -->
438                         <phase>package</phase>
439                         <configuration>
440                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/lib</outputDirectory>
441                             <resources>
442                                 <resource>
443                                     <directory>${basedir}/target</directory>
444                                     <includes>
445                                         <include>${ccsdk.sliboot.jar}</include>
446                                     </includes>
447                                     <filtering>false</filtering>
448                                 </resource>
449                             </resources>
450                         </configuration>
451                     </execution>
452                 </executions>
453             </plugin>
454
455         </plugins>
456     </build>
457
458     <profiles>
459         <profile>
460             <id>docker</id>
461             <build>
462                 <plugins>
463                     <plugin>
464                         <groupId>org.apache.maven.plugins</groupId>
465                         <artifactId>maven-failsafe-plugin</artifactId>
466                         <executions>
467                             <execution>
468                                 <goals>
469                                     <goal>integration-test</goal>
470                                     <goal>verify</goal>
471                                 </goals>
472                             </execution>
473                         </executions>
474                         <configuration>
475                             <skipITs>false</skipITs>
476                             <environmentVariables>
477                                 <SLIBOOT_PORT>${sliboot.port}</SLIBOOT_PORT>
478                             </environmentVariables>
479                         </configuration>
480                     </plugin>
481                     <plugin>
482                         <groupId>io.fabric8</groupId>
483                         <artifactId>docker-maven-plugin</artifactId>
484                         <version>0.34.0</version>
485                         <inherited>false</inherited>
486                         <configuration>
487                             <images>
488                                 <image>
489                                     <name>${image.name}</name>
490                                     <build>
491                                         <cleanup>try</cleanup>
492                                         <noCache>true</noCache>
493                                         <contextDir>${basedir}/target/docker-stage</contextDir>
494                                         <dockerFile>Dockerfile</dockerFile>
495                                         <tags>
496                                             <tag>${project.docker.latestminortag.version}</tag>
497                                             <tag>${project.docker.latestfulltag.version}</tag>
498                                             <tag>${project.docker.latesttagtimestamp.version}</tag>
499                                         </tags>
500                                     </build>
501                                 </image>
502                             </images>
503                         </configuration>
504                         <executions>
505                             <execution>
506                                 <id>generate-images</id>
507                                 <phase>package</phase>
508                                 <goals>
509                                     <goal>build</goal>
510                                 </goals>
511                             </execution>
512                             <execution>
513                                 <id>start-it-instance</id>
514                                 <phase>pre-integration-test</phase>
515                                 <goals>
516                                     <goal>start</goal>
517                                 </goals>
518                                 <configuration>
519                                     <images>
520                                         <image>
521                                             <name>mariadb:latest</name>
522                                             <alias>slibootdb</alias>
523                                             <run>
524                                                 <env>
525                                                     <MYSQL_ROOT_PASSWORD>itsASecret</MYSQL_ROOT_PASSWORD>
526                                                     <MYSQL_USER>sli</MYSQL_USER>
527                                                     <MYSQL_PASSWORD>abc123</MYSQL_PASSWORD>
528                                                     <MYSQL_DATABASE>sdnctl</MYSQL_DATABASE>
529                                                 </env>
530                                                 <network>
531                                                     <mode>custom</mode>
532                                                     <name>onap</name>
533                                                     <alias>dbhost</alias>
534                                                 </network>
535                                                 <ports>
536                                                     <port>slibootdb.port:3306</port>
537                                                 </ports>
538                                                 <log>
539                                                     <enabled>true</enabled>
540                                                 </log>
541                                             </run>
542                                         </image>
543                                         <image>
544                                             <name>${image.name}:${project.docker.latesttagtimestamp.version}</name>
545                                             <alias>sliboot-container</alias>
546                                             <run>
547                                                 <env>
548                                                     <MYSQL_USER>sli</MYSQL_USER>
549                                                     <MYSQL_PASSWORD>abc123</MYSQL_PASSWORD>
550                                                     <MYSQL_DATABASE>sdnctl</MYSQL_DATABASE>
551                                                     <MYSQL_HOST>dbhost</MYSQL_HOST>
552                                                     <SDNC_CONFIG_DIR>/opt/onap/ccsdk/config</SDNC_CONFIG_DIR>
553                                                 </env>
554                                                 <dependsOn>
555                                                     <container>slibootdb</container>
556                                                 </dependsOn>
557                                                 <network>
558                                                     <mode>custom</mode>
559                                                     <name>onap</name>
560                                                     <alias>sliboot</alias>
561                                                 </network>
562                                                 <ports>
563                                                     <port>sliboot.port:8080</port>
564                                                 </ports>
565                                                 <wait>
566                                                     <log>Started SlibootApp</log>
567                                                     <time>120000</time>
568                                                 </wait>
569                                                 <log>
570                                                     <enabled>true</enabled>
571                                                 </log>
572                                             </run>
573                                         </image>
574                                     </images>
575                                 </configuration>
576                             </execution>
577                             <execution>
578                                 <id>stop-it-instance</id>
579                                 <phase>post-integration-test</phase>
580                                 <goals>
581                                     <goal>stop</goal>
582                                 </goals>
583                             </execution>
584                             <execution>
585                                 <id>push-images</id>
586                                 <goals>
587                                     <goal>push</goal>
588                                 </goals>
589                             </execution>
590                         </executions>
591                     </plugin>
592                 </plugins>
593             </build>
594         </profile>
595     </profiles>
596 </project>