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