Add Spring Boot Actuator
[cps/cps-temporal.git] / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   ============LICENSE_START=======================================================
4   Copyright (c) 2021 Bell Canada.
5   Modifications Copyright (C) 2021 Nordix Foundation.
6   ================================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10
11         http://www.apache.org/licenses/LICENSE-2.0
12
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18
19  SPDX-License-Identifier: Apache-2.0
20   ============LICENSE_END=========================================================
21 -->
22
23 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
25     <modelVersion>4.0.0</modelVersion>
26
27     <parent>
28         <groupId>org.onap.oparent</groupId>
29         <artifactId>oparent</artifactId>
30         <version>3.2.0</version>
31         <relativePath/>
32     </parent>
33
34     <groupId>org.onap.cps</groupId>
35     <artifactId>cps-temporal</artifactId>
36     <version>0.0.1-SNAPSHOT</version>
37     <name>cps-temporal</name>
38     <description>CPS Temporal Service</description>
39
40     <properties>
41         <docker.repository.pull>nexus3.onap.org:10001/</docker.repository.pull>
42         <docker.repository.push>nexus3.onap.org:10003/</docker.repository.push>
43         <image.base>${docker.repository.pull}onap/integration-java11:8.0.0</image.base>
44         <image.name>${docker.repository.push}onap/cps-temporal</image.name>
45         <java.version>11</java.version>
46         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
47         <minimum-coverage>0.8</minimum-coverage>
48         <!-- Application dependencies versions -->
49         <!--cps.version need to be changed to released Istanbul version-->
50         <cps.version>1.1.0-SNAPSHOT</cps.version>
51         <mapstruct.version>1.4.2.Final</mapstruct.version>
52     </properties>
53
54     <dependencyManagement>
55         <dependencies>
56             <dependency>
57                 <groupId>org.springframework.boot</groupId>
58                 <artifactId>spring-boot-dependencies</artifactId>
59                 <version>2.5.0</version>
60                 <type>pom</type>
61                 <scope>import</scope>
62             </dependency>
63             <dependency>
64                 <groupId>org.spockframework</groupId>
65                 <artifactId>spock-bom</artifactId>
66                 <version>2.0-M4-groovy-3.0</version>
67                 <type>pom</type>
68                 <scope>import</scope>
69             </dependency>
70             <dependency>
71                 <groupId>org.testcontainers</groupId>
72                 <artifactId>testcontainers-bom</artifactId>
73                 <version>1.15.3</version>
74                 <type>pom</type>
75                 <scope>import</scope>
76             </dependency>
77         </dependencies>
78     </dependencyManagement>
79
80     <dependencies>
81         <dependency>
82             <groupId>org.springframework.boot</groupId>
83             <artifactId>spring-boot-starter</artifactId>
84         </dependency>
85         <dependency>
86             <groupId>org.springframework.boot</groupId>
87             <artifactId>spring-boot-starter-web</artifactId>
88         </dependency>
89         <dependency>
90             <groupId>org.springframework.boot</groupId>
91             <artifactId>spring-boot-starter-data-jpa</artifactId>
92         </dependency>
93         <dependency>
94             <groupId>org.springframework.boot</groupId>
95             <artifactId>spring-boot-starter-actuator</artifactId>
96         </dependency>
97         <dependency>
98             <groupId>io.micrometer</groupId>
99             <artifactId>micrometer-registry-prometheus</artifactId>
100         </dependency>
101         <dependency>
102             <groupId>com.vladmihalcea</groupId>
103             <artifactId>hibernate-types-52</artifactId>
104             <version>2.10.0</version>
105         </dependency>
106         <dependency>
107             <groupId>org.liquibase</groupId>
108             <artifactId>liquibase-core</artifactId>
109             <version>4.3.2</version>
110         </dependency>
111         <dependency>
112             <groupId>org.projectlombok</groupId>
113             <artifactId>lombok</artifactId>
114         </dependency>
115         <dependency>
116             <groupId>org.springframework.boot</groupId>
117             <artifactId>spring-boot-starter-validation</artifactId>
118         </dependency>
119         <dependency>
120             <groupId>org.mapstruct</groupId>
121             <artifactId>mapstruct</artifactId>
122             <version>${mapstruct.version}</version>
123         </dependency>
124         <dependency>
125             <groupId>org.springframework.kafka</groupId>
126             <artifactId>spring-kafka</artifactId>
127         </dependency>
128         <dependency>
129             <groupId>org.onap.cps</groupId>
130             <artifactId>cps-events</artifactId>
131             <version>1.1.0-SNAPSHOT</version>
132         </dependency>
133         <dependency>
134             <groupId>org.springdoc</groupId>
135             <artifactId>springdoc-openapi-ui</artifactId>
136             <version>1.5.9</version>
137         </dependency>
138         <!-- Runtime dependencies-->
139         <dependency>
140             <groupId>org.postgresql</groupId>
141             <artifactId>postgresql</artifactId>
142             <scope>runtime</scope>
143         </dependency>
144         <!-- Test dependencies-->
145         <dependency>
146             <groupId>org.codehaus.groovy</groupId>
147             <artifactId>groovy</artifactId>
148             <version>3.0.7</version>
149         </dependency>
150         <dependency>
151             <groupId>org.springframework.boot</groupId>
152             <artifactId>spring-boot-starter-test</artifactId>
153             <scope>test</scope>
154             <exclusions>
155                 <exclusion>
156                     <groupId>org.junit.vintage</groupId>
157                     <artifactId>junit-vintage-engine</artifactId>
158                 </exclusion>
159             </exclusions>
160         </dependency>
161         <dependency>
162             <groupId>org.spockframework</groupId>
163             <artifactId>spock-core</artifactId>
164             <scope>test</scope>
165         </dependency>
166         <dependency>
167             <groupId>org.spockframework</groupId>
168             <artifactId>spock-spring</artifactId>
169             <scope>test</scope>
170         </dependency>
171         <dependency>
172             <groupId>org.testcontainers</groupId>
173             <artifactId>spock</artifactId>
174             <scope>test</scope>
175         </dependency>
176         <dependency>
177             <groupId>org.testcontainers</groupId>
178             <artifactId>postgresql</artifactId>
179             <scope>test</scope>
180         </dependency>
181         <dependency>
182             <groupId>org.testcontainers</groupId>
183             <artifactId>kafka</artifactId>
184             <scope>test</scope>
185         </dependency>
186         <dependency>
187             <groupId>org.springframework.kafka</groupId>
188             <artifactId>spring-kafka-test</artifactId>
189             <scope>test</scope>
190         </dependency>
191         <dependency>
192             <groupId>com.tngtech.archunit</groupId>
193             <artifactId>archunit-junit5</artifactId>
194             <version>0.18.0</version>
195             <scope>test</scope>
196         </dependency>
197     </dependencies>
198
199     <build>
200         <resources>
201             <resource>
202                 <directory>docs/api</directory>
203                 <targetPath>static</targetPath>
204                 <filtering>true</filtering>
205             </resource>
206             <resource>
207                 <directory>src/main/resources</directory>
208                 <filtering>true</filtering>
209             </resource>
210         </resources>
211         <plugins>
212             <plugin>
213                 <groupId>org.apache.maven.plugins</groupId>
214                 <artifactId>maven-compiler-plugin</artifactId>
215                 <version>3.8.1</version>
216                 <configuration>
217                     <annotationProcessorPaths>
218                         <path>
219                             <groupId>org.projectlombok</groupId>
220                             <artifactId>lombok</artifactId>
221                             <version>1.18.20</version>
222                         </path>
223                         <path>
224                             <groupId>org.mapstruct</groupId>
225                             <artifactId>mapstruct-processor</artifactId>
226                             <version>${mapstruct.version}</version>
227                         </path>
228                     </annotationProcessorPaths>
229                 </configuration>
230             </plugin>
231             <plugin>
232                 <groupId>org.springframework.boot</groupId>
233                 <artifactId>spring-boot-maven-plugin</artifactId>
234                 <version>2.3.3.RELEASE</version>
235                 <executions>
236                     <execution>
237                         <goals>
238                             <goal>build-info</goal>
239                             <goal>repackage</goal>
240                         </goals>
241                     </execution>
242                 </executions>
243             </plugin>
244             <plugin>
245                 <!-- The gmavenplus plugin is used to compile Groovy code. To learn more about this plugin,
246                 visit https://github.com/groovy/GMavenPlus/wiki -->
247                 <groupId>org.codehaus.gmavenplus</groupId>
248                 <artifactId>gmavenplus-plugin</artifactId>
249                 <version>1.12.1</version>
250                 <executions>
251                     <execution>
252                         <goals>
253                             <goal>compile</goal>
254                             <goal>compileTests</goal>
255                         </goals>
256                     </execution>
257                 </executions>
258             </plugin>
259             <plugin>
260                 <groupId>org.apache.maven.plugins</groupId>
261                 <artifactId>maven-checkstyle-plugin</artifactId>
262                 <executions>
263                     <execution>
264                         <id>onap-license</id>
265                         <goals>
266                             <goal>check</goal>
267                         </goals>
268                         <phase>process-sources</phase>
269                         <configuration>
270                             <configLocation>onap-checkstyle/check-license.xml</configLocation>
271                             <includeResources>false</includeResources>
272                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
273                             <includeTestResources>false</includeTestResources>
274                             <sourceDirectories>
275                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
276                             </sourceDirectories>
277                             <consoleOutput>false</consoleOutput>
278                             <violationSeverity>warning</violationSeverity>
279                             <failOnViolation>true</failOnViolation>
280                         </configuration>
281                     </execution>
282                     <execution>
283                         <id>onap-java-style</id>
284                         <goals>
285                             <goal>check</goal>
286                         </goals>
287                         <phase>process-sources</phase>
288                         <configuration>
289                             <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
290                             <sourceDirectories>
291                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
292                             </sourceDirectories>
293                             <includeResources>true</includeResources>
294                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
295                             <includeTestResources>true</includeTestResources>
296                             <consoleOutput>false</consoleOutput>
297                             <violationSeverity>warning</violationSeverity>
298                             <failOnViolation>true</failOnViolation>
299                         </configuration>
300                     </execution>
301                     <execution>
302                         <id>cps-java-style</id>
303                         <goals>
304                             <goal>check</goal>
305                         </goals>
306                         <phase>process-sources</phase>
307                         <configuration>
308                             <configLocation>cps-java-style.xml</configLocation>
309                             <sourceDirectories>
310                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
311                             </sourceDirectories>
312                             <includeResources>true</includeResources>
313                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
314                             <includeTestResources>true</includeTestResources>
315                             <consoleOutput>true</consoleOutput>
316                             <violationSeverity>warning</violationSeverity>
317                             <failOnViolation>true</failOnViolation>
318                         </configuration>
319                     </execution>
320                 </executions>
321                 <dependencies>
322                     <dependency>
323                         <groupId>org.onap.oparent</groupId>
324                         <artifactId>checkstyle</artifactId>
325                         <version>3.2.0</version>
326                     </dependency>
327                     <dependency>
328                         <groupId>org.onap.cps</groupId>
329                         <artifactId>checkstyle</artifactId>
330                         <version>${cps.version}</version>
331                     </dependency>
332                 </dependencies>
333             </plugin>
334             <plugin>
335                 <groupId>com.github.spotbugs</groupId>
336                 <artifactId>spotbugs-maven-plugin</artifactId>
337                 <version>4.1.3</version>
338                 <dependencies>
339                     <dependency>
340                         <groupId>com.github.spotbugs</groupId>
341                         <artifactId>spotbugs</artifactId>
342                         <version>4.2.0</version>
343                     </dependency>
344                     <dependency>
345                         <groupId>org.onap.cps</groupId>
346                         <artifactId>spotbugs</artifactId>
347                         <version>${cps.version}</version>
348                     </dependency>
349                     <dependency>
350                         <!-- The SpotBugs Maven plugin uses SLF4J 1.8 beta 2 -->
351                         <groupId>org.slf4j</groupId>
352                         <artifactId>slf4j-simple</artifactId>
353                         <version>1.8.0-beta4</version>
354                     </dependency>
355                 </dependencies>
356                 <configuration>
357                     <plugins>
358                         <plugin>
359                             <groupId>jp.skypencil.findbugs.slf4j</groupId>
360                             <artifactId>bug-pattern</artifactId>
361                             <version>1.5.0</version>
362                         </plugin>
363                     </plugins>
364                     <!--
365                       Enables analysis which takes more memory but finds more bugs.
366                       If you run out of memory, changes the value of the effort element
367                       to 'Low'.
368                     -->
369                     <effort>Max</effort>
370                     <addSourceDirs>true</addSourceDirs>
371                     <!-- Reports all bugs (other values are medium and max) -->
372                     <threshold>Low</threshold>
373                     <!-- Build doesn't fail if problems are found -->
374                     <failOnError>true</failOnError>
375                     <!-- References the excluded rules -->
376                     <excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
377                     <!-- Produces XML report -->
378                     <xmlOutput>true</xmlOutput>
379                     <!-- Configures the directory in which the XML report is created -->
380                     <xmlOutputDirectory>${project.build.directory}/spotbugs</xmlOutputDirectory>
381                 </configuration>
382                 <executions>
383                     <!--
384                       Ensures that SpotBugs inspects source code when project is compiled.
385                     -->
386                     <execution>
387                         <id>analyze-compile</id>
388                         <phase>compile</phase>
389                         <goals>
390                             <goal>check</goal>
391                         </goals>
392                     </execution>
393                 </executions>
394             </plugin>
395             <plugin>
396                 <groupId>org.apache.maven.plugins</groupId>
397                 <artifactId>maven-surefire-plugin</artifactId>
398                 <configuration>
399                     <!--suppress UnresolvedMavenProperty -->
400                     <argLine>${surefireArgLine}</argLine>
401                     <useFile>false</useFile>
402                     <includes>
403                         <include>**/*Spec.java</include>
404                         <include>**/*Test.java</include>
405                     </includes>
406                     <environmentVariables>
407                         <!--
408                             Disable privileged container usage to cleanup the test containers;
409                             these are removed automatically on jvm termination;
410                             see https://www.testcontainers.org/features/configuration/#disabling-ryuk
411                         -->
412                         <TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
413                     </environmentVariables>
414                 </configuration>
415             </plugin>
416             <plugin>
417                 <groupId>org.jacoco</groupId>
418                 <artifactId>jacoco-maven-plugin</artifactId>
419                 <executions>
420                     <execution>
421                         <id>coverage-prepare-agent</id>
422                         <goals>
423                             <goal>prepare-agent</goal>
424                         </goals>
425                     </execution>
426                     <execution>
427                         <id>coverage-check</id>
428                         <goals>
429                             <goal>check</goal>
430                         </goals>
431                         <configuration>
432                             <excludes>
433                                 <exclude>org/onap/cps/temporal/controller/rest/model/*</exclude>
434                             </excludes>
435                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
436                             <rules>
437                                 <rule>
438                                     <element>BUNDLE</element>
439                                     <limits>
440                                         <limit>
441                                             <counter>INSTRUCTION</counter>
442                                             <value>COVEREDRATIO</value>
443                                             <minimum>${minimum-coverage}</minimum>
444                                         </limit>
445                                     </limits>
446                                 </rule>
447                             </rules>
448                         </configuration>
449                     </execution>
450                     <execution>
451                         <id>coverage-report</id>
452                         <goals>
453                             <goal>report</goal>
454                         </goals>
455                         <configuration>
456                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
457                         </configuration>
458                     </execution>
459                 </executions>
460             </plugin>
461             <plugin>
462                 <groupId>io.swagger.codegen.v3</groupId>
463                 <artifactId>swagger-codegen-maven-plugin</artifactId>
464                 <version>3.0.27</version>
465                 <executions>
466                     <execution>
467                         <goals>
468                             <goal>generate</goal>
469                         </goals>
470                         <configuration>
471                             <inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec>
472                             <invokerPackage>org.onap.cps.temporal.controller.rest</invokerPackage>
473                             <modelPackage>org.onap.cps.temporal.controller.rest.model</modelPackage>
474                             <apiPackage>org.onap.cps.temporal.controller.rest</apiPackage>
475                             <language>spring</language>
476                             <generateSupportingFiles>false</generateSupportingFiles>
477                             <configOptions>
478                                 <sourceFolder>src/gen/java</sourceFolder>
479                                 <dateLibrary>java11</dateLibrary>
480                                 <interfaceOnly>true</interfaceOnly>
481                                 <useTags>true</useTags>
482                             </configOptions>
483                         </configuration>
484                     </execution>
485                 </executions>
486             </plugin>
487         </plugins>
488
489        <pluginManagement>
490             <plugins>
491                 <plugin>
492                     <groupId>org.apache.maven.plugins</groupId>
493                     <artifactId>maven-surefire-plugin</artifactId>
494                     <version>3.0.0-M5</version>
495                 </plugin>
496                 <plugin>
497                     <groupId>com.google.cloud.tools</groupId>
498                     <artifactId>jib-maven-plugin</artifactId>
499                     <version>3.0.0</version>
500                     <configuration>
501                         <container>
502                             <mainClass>${app}</mainClass>
503                             <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
504                         </container>
505                         <from>
506                             <image>${image.base}</image>
507                         </from>
508                         <to>
509                             <tags>
510                                 <tag>latest</tag>
511                             </tags>
512                             <image>${image.name}:${project.version}-${maven.build.timestamp}</image>
513                         </to>
514                     </configuration>
515                     <executions>
516                         <execution>
517                             <phase>package</phase>
518                             <id>build</id>
519                             <goals>
520                                 <goal>dockerBuild</goal>
521                             </goals>
522                         </execution>
523                         <execution>
524                             <phase>deploy</phase>
525                             <id>buildAndPush</id>
526                             <goals>
527                                 <goal>build</goal>
528                             </goals>
529                         </execution>
530                     </executions>
531                 </plugin>
532             </plugins>
533         </pluginManagement>
534     </build>
535
536     <profiles>
537         <profile>
538             <id>docker</id>
539             <build>
540                 <plugins>
541                     <plugin>
542                         <groupId>com.google.cloud.tools</groupId>
543                         <artifactId>jib-maven-plugin</artifactId>
544                     </plugin>
545                 </plugins>
546             </build>
547         </profile>
548     </profiles>
549 </project>