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