Release 1.1.0 dockers and roll version
[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.1.1</version>
9         <relativePath/>
10     </parent>
11
12     <groupId>org.onap.ccsdk.apps</groupId>
13     <artifactId>sliboot</artifactId>
14     <version>1.1.1-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>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         <!-- this jersey jar is needed for rest api call node to function properly -->
150         <dependency>
151             <groupId>org.glassfish.jersey.inject</groupId>
152             <artifactId>jersey-hk2</artifactId>
153         </dependency>
154     </dependencies>
155
156     <build>
157         <plugins>
158             <plugin>
159                 <groupId>org.codehaus.groovy.maven</groupId>
160                 <artifactId>gmaven-plugin</artifactId>
161                 <executions>
162                     <execution>
163                         <phase>validate</phase>
164                         <goals>
165                             <goal>execute</goal>
166                         </goals>
167                         <configuration>
168                             <source>${basedir}/TagVersion.groovy</source>
169                         </configuration>
170                     </execution>
171                 </executions>
172             </plugin>
173
174             <plugin>
175                 <groupId>org.apache.maven.plugins</groupId>
176                 <artifactId>maven-dependency-plugin</artifactId>
177                 <version>2.10</version>
178
179                 <executions>
180                     <execution>
181                         <id>get-sliapi-yaml</id>
182                         <phase>initialize</phase>
183                         <goals>
184                             <goal>copy</goal>
185                         </goals>
186                         <configuration>
187                             <artifactItems>
188                                 <artifactItem>
189                                     <groupId>org.onap.ccsdk.sli.core</groupId>
190                                     <artifactId>sliapi-model-swagger</artifactId>
191                                     <version>${ccsdk.sli.core.version}</version>
192                                     <type>yaml</type>
193                                     <outputDirectory>${project.build.directory}/yaml</outputDirectory>
194                                     <destFileName>sliapi.yaml</destFileName>
195                                 </artifactItem>
196                             </artifactItems>
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                             <outputDirectory>${project.build.directory}/docker-stage/opt/onap/ccsdk/lib</outputDirectory>
208                             <overWriteReleases>false</overWriteReleases>
209                             <overWriteSnapshots>true</overWriteSnapshots>
210                             <overWriteIfNewer>true</overWriteIfNewer>
211                             <useRepositoryLayout>false</useRepositoryLayout>
212                             <addParentPoms>false</addParentPoms>
213                             <copyPom>false</copyPom>
214                         </configuration>
215                     </execution>
216                     <execution>
217                         <id>unpack dgs</id>
218                         <phase>generate-sources</phase>
219                         <goals>
220                             <goal>unpack</goal>
221                         </goals>
222                         <configuration>
223                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk</outputDirectory>
224                             <artifactItems>
225                                 <artifactItem>
226                                     <groupId>org.onap.ccsdk.distribution</groupId>
227                                     <artifactId>platform-logic-installer</artifactId>
228                                     <version>${ccsdk.distribution.version}</version>
229                                     <type>zip</type>
230                                 </artifactItem>
231                             </artifactItems>
232                         </configuration>
233                     </execution>
234                 </executions>
235             </plugin>
236             <plugin>
237                 <groupId>io.swagger</groupId>
238                 <artifactId>swagger-codegen-maven-plugin</artifactId>
239                 <version>2.3.1</version>
240                 <executions>
241                     <execution>
242                         <phase>generate-sources</phase>
243                         <goals>
244                             <goal>generate</goal>
245                         </goals>
246                         <configuration>
247                             <output>target/generated-sources</output>
248                             <inputSpec>${project.build.directory}/yaml/sliapi.yaml</inputSpec>
249                             <language>spring</language>
250                             <apiPackage>org.onap.ccsdk.apps.ms.sliboot.swagger</apiPackage>
251                             <modelPackage>org.onap.ccsdk.apps.ms.sliboot.swagger.model</modelPackage>
252                             <invokerPackage>org.onap.ccsdk.apps.ms.sliboot.swagger</invokerPackage>
253                             <generateApis>true</generateApis>
254                             <generateApiTests>true</generateApiTests>
255                             <ignoreFileOverride>${project.basedir}/.swagger-codegen-ignore</ignoreFileOverride>
256                             <withXml>true</withXml>
257                             <templateDirectory>${project.basedir}/src/main/templates</templateDirectory>
258                             <configOptions>
259                                 <java8>true</java8>
260                                 <springBootVersion>2.2.4-RELEASE</springBootVersion>
261                             </configOptions>
262                         </configuration>
263                     </execution>
264                 </executions>
265             </plugin>
266             <plugin>
267                 <groupId>org.springframework.boot</groupId>
268                 <artifactId>spring-boot-maven-plugin</artifactId>
269                 <configuration>
270                     <classifier>exec</classifier>
271                 </configuration>
272                 <executions>
273                     <execution>
274                         <goals>
275                             <goal>repackage</goal>
276                         </goals>
277                     </execution>
278                 </executions>
279             </plugin>
280             <plugin>
281                 <groupId>org.apache.maven.plugins</groupId>
282                 <artifactId>maven-surefire-plugin</artifactId>
283                 <version>2.19.1</version>
284                 <configuration>
285                     <forkMode>always</forkMode>
286                     <environmentVariables>
287                         <SDNC_CONFIG_DIR>${basedir}/src/test/resources</SDNC_CONFIG_DIR>
288                         <SVCLOGIC_PROPERTIES>${basedir}/src/test/resources/svclogic.properties</SVCLOGIC_PROPERTIES>
289                     </environmentVariables>
290                 </configuration>
291             </plugin>
292             <plugin>
293                 <groupId>org.apache.maven.plugins</groupId>
294                 <artifactId>maven-failsafe-plugin</artifactId>
295                 <executions>
296                   <execution>
297                     <goals>
298                       <goal>integration-test</goal>
299                       <goal>verify</goal>
300                     </goals>
301                   </execution>
302                 </executions>
303                 <configuration>
304                   <skipITs>true</skipITs>
305                 </configuration>
306               </plugin>
307               <plugin>
308                 <artifactId>maven-resources-plugin</artifactId>
309                 <version>2.6</version>
310                 <executions>
311                     <execution>
312                         <id>copy-dockerfile</id>
313                         <goals>
314                             <goal>copy-resources</goal>
315                         </goals><!-- here the phase you need -->
316                         <phase>initialize</phase>
317                         <configuration>
318                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
319                             <resources>
320                                 <resource>
321                                     <directory>src/main/docker</directory>
322                                     <includes>
323                                         <include>Dockerfile</include>
324                                     </includes>
325                                     <filtering>true</filtering>
326                                 </resource>
327                             </resources>
328                         </configuration>
329                     </execution>
330                     <execution>
331                         <id>copy-config</id>
332                         <goals>
333                             <goal>copy-resources</goal>
334                         </goals><!-- here the phase you need -->
335                         <phase>generate-resources</phase>
336                         <configuration>
337                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/config</outputDirectory>
338                             <resources>
339                                 <resource>
340                                     <directory>src/main/resources</directory>
341                                     <includes>
342                                         <include>*.properties</include>
343                                         <include>*.props</include>
344                                         <include>*.sql</include>
345                                     </includes>
346                                     <filtering>true</filtering>
347                                 </resource>
348                                 <resource>
349                                     <directory>src/main/resources</directory>
350                                     <includes>
351                                         <include>*.keyfile</include>
352                                         <include>*.jks</include>
353                                         <include>*.p12</include>
354                                     </includes>
355                                     <filtering>false</filtering>
356                                 </resource>
357                             </resources>
358                         </configuration>
359                     </execution>
360                     <execution>
361                         <id>copy-script</id>
362                         <goals>
363                             <goal>copy-resources</goal>
364                         </goals><!-- here the phase you need -->
365                         <phase>generate-resources</phase>
366                         <configuration>
367                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/bin</outputDirectory>
368                             <resources>
369                                 <resource>
370                                     <directory>src/main/resources</directory>
371                                     <includes>
372                                         <include>*.sh</include>
373                                     </includes>
374                                     <filtering>true</filtering>
375                                 </resource>
376                             </resources>
377                         </configuration>
378                     </execution>
379                     <execution>
380                         <id>copy-jar</id>
381                         <goals>
382                             <goal>copy-resources</goal>
383                         </goals><!-- here the phase you need -->
384                         <phase>package</phase>
385                         <configuration>
386                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/lib</outputDirectory>
387                             <resources>
388                                 <resource>
389                                     <directory>${basedir}/target</directory>
390                                     <includes>
391                                         <include>${ccsdk.sliboot.jar}</include>
392                                     </includes>
393                                     <filtering>false</filtering>
394                                 </resource>
395                             </resources>
396                         </configuration>
397                     </execution>
398                 </executions>
399             </plugin>
400
401         </plugins>
402     </build>
403
404     <profiles>
405         <profile>
406             <id>docker</id>
407             <build>
408                 <plugins>
409                     <plugin>
410                         <groupId>org.apache.maven.plugins</groupId>
411                         <artifactId>maven-failsafe-plugin</artifactId>
412                         <executions>
413                           <execution>
414                             <goals>
415                               <goal>integration-test</goal>
416                               <goal>verify</goal>
417                             </goals>
418                           </execution>
419                         </executions>
420                         <configuration>
421                           <skipITs>false</skipITs>
422                           <environmentVariables>
423                             <SLIBOOT_PORT>${sliboot.port}</SLIBOOT_PORT>
424                           </environmentVariables>
425                         </configuration>
426                       </plugin>
427                     <plugin>
428                         <groupId>io.fabric8</groupId>
429                         <artifactId>docker-maven-plugin</artifactId>
430                         <version>0.28.0</version>
431                         <inherited>false</inherited>
432                         <configuration>
433                             <images>
434                                 <image>
435                                     <name>${image.name}</name>
436                                     <build>
437                                         <cleanup>try</cleanup>
438                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
439                                         <dockerFile>Dockerfile</dockerFile>
440                                         <tags>
441                                             <tag>${project.docker.latestminortag.version}</tag>
442                                             <tag>${project.docker.latestfulltag.version}</tag>
443                                             <tag>${project.docker.latesttagtimestamp.version}</tag>
444                                         </tags>
445                                     </build>
446                                 </image>
447                             </images>
448                         </configuration>
449                         <executions>
450                             <execution>
451                                 <id>generate-images</id>
452                                 <phase>package</phase>
453                                 <goals>
454                                     <goal>build</goal>
455                                 </goals>
456                             </execution>
457         
458                             <execution>
459                                 <id>start-it-instance</id>
460                                 <phase>pre-integration-test</phase>
461                                 <goals>
462                                     <goal>start</goal>
463                                 </goals>
464                                 <configuration>
465                                     <images>
466                                         <image>
467                                             <name>mariadb:10.5</name>
468                                             <alias>slibootdb</alias>
469                                             <run>
470                                                 <env>
471                                                     <MYSQL_ROOT_PASSWORD>itsASecret</MYSQL_ROOT_PASSWORD>
472                                                     <MYSQL_USER>sli</MYSQL_USER>
473                                                     <MYSQL_PASSWORD>abc123</MYSQL_PASSWORD>
474                                                     <MYSQL_DATABASE>sdnctl</MYSQL_DATABASE>
475                                                 </env>
476                                                 <network>
477                                                     <mode>custom</mode>
478                                                     <name>onap</name>
479                                                     <alias>dbhost</alias>
480                                                 </network>
481                                                 <ports>
482                                                     <port>slibootdb.port:3306</port>
483                                                 </ports>
484                                                 <log>
485                                                     <enabled>true</enabled>
486                                                 </log>
487                                             </run>
488                                         </image>
489                                         <image>
490                                             <name>${image.name}:${project.docker.latesttagtimestamp.version}</name>
491                                             <alias>sliboot-container</alias>
492                                             <run>
493                                                 <env>
494                                                     <MYSQL_USER>sli</MYSQL_USER>
495                                                     <MYSQL_PASSWORD>abc123</MYSQL_PASSWORD>
496                                                     <MYSQL_DATABASE>sdnctl</MYSQL_DATABASE>
497                                                     <SDNC_CONFIG_DIR>/opt/onap/ccsdk/config</SDNC_CONFIG_DIR>
498                                                 </env>
499                                                 <dependsOn>
500                                                     <container>slibootdb</container>
501                                                 </dependsOn>
502                                                 <network>
503                                                     <mode>custom</mode>
504                                                     <name>onap</name>
505                                                     <alias>sliboot</alias>
506                                                 </network>
507                                                 <ports>
508                                                     <port>sliboot.port:8080</port>
509                                                 </ports>
510                                                 <wait>
511                                                     <log>Started SlibootApp</log>
512                                                     <time>120000</time>
513                                                 </wait>
514                                                 <log>
515                                                     <enabled>true</enabled>
516                                                 </log>
517                                             </run>
518                                         </image>
519                                     </images>
520                                 </configuration>
521                             </execution>
522                             <execution>
523                                 <id>stop-it-instance</id>
524                                 <phase>post-integration-test</phase>
525                                 <goals>
526                                     <goal>stop</goal>
527                                 </goals>
528                             </execution>
529                             <execution>
530                                 <id>push-images</id>
531                                 <phase>${docker.push.phase}</phase>
532                                 <goals>
533                                     <goal>build</goal>
534                                     <goal>push</goal>
535                                 </goals>
536                             </execution>
537                         </executions>
538                     </plugin>
539
540                 </plugins>
541             </build>
542         </profile>
543     </profiles>
544 </project>