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