Merge "Validate controller input and provide expected response"
[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.2-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</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.springframework.boot</groupId>
121             <artifactId>spring-boot-starter-hateoas</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>1.1.0</version>
136         </dependency>
137         <dependency>
138             <groupId>org.springdoc</groupId>
139             <artifactId>springdoc-openapi-ui</artifactId>
140             <version>1.5.9</version>
141         </dependency>
142         <!-- Runtime dependencies-->
143         <dependency>
144             <groupId>org.postgresql</groupId>
145             <artifactId>postgresql</artifactId>
146             <scope>runtime</scope>
147         </dependency>
148         <!-- Test dependencies-->
149         <dependency>
150             <groupId>org.codehaus.groovy</groupId>
151             <artifactId>groovy</artifactId>
152             <version>3.0.7</version>
153         </dependency>
154         <dependency>
155             <groupId>org.springframework.boot</groupId>
156             <artifactId>spring-boot-starter-test</artifactId>
157             <scope>test</scope>
158             <exclusions>
159                 <exclusion>
160                     <groupId>org.junit.vintage</groupId>
161                     <artifactId>junit-vintage-engine</artifactId>
162                 </exclusion>
163             </exclusions>
164         </dependency>
165         <dependency>
166             <groupId>org.spockframework</groupId>
167             <artifactId>spock-core</artifactId>
168             <scope>test</scope>
169         </dependency>
170         <dependency>
171             <groupId>org.spockframework</groupId>
172             <artifactId>spock-spring</artifactId>
173             <scope>test</scope>
174         </dependency>
175         <dependency>
176             <groupId>org.testcontainers</groupId>
177             <artifactId>spock</artifactId>
178             <scope>test</scope>
179         </dependency>
180         <dependency>
181             <groupId>org.testcontainers</groupId>
182             <artifactId>postgresql</artifactId>
183             <scope>test</scope>
184         </dependency>
185         <dependency>
186             <groupId>org.testcontainers</groupId>
187             <artifactId>kafka</artifactId>
188             <scope>test</scope>
189         </dependency>
190         <dependency>
191             <groupId>org.springframework.kafka</groupId>
192             <artifactId>spring-kafka-test</artifactId>
193             <scope>test</scope>
194         </dependency>
195         <dependency>
196             <groupId>com.tngtech.archunit</groupId>
197             <artifactId>archunit-junit5</artifactId>
198             <version>0.18.0</version>
199             <scope>test</scope>
200         </dependency>
201     </dependencies>
202
203     <build>
204         <resources>
205             <resource>
206                 <directory>docs/api</directory>
207                 <targetPath>static</targetPath>
208                 <filtering>true</filtering>
209             </resource>
210             <resource>
211                 <directory>src/main/resources</directory>
212                 <filtering>true</filtering>
213             </resource>
214         </resources>
215         <plugins>
216             <plugin>
217                 <groupId>org.apache.maven.plugins</groupId>
218                 <artifactId>maven-compiler-plugin</artifactId>
219                 <version>3.8.1</version>
220                 <configuration>
221                     <annotationProcessorPaths>
222                         <path>
223                             <groupId>org.projectlombok</groupId>
224                             <artifactId>lombok</artifactId>
225                             <version>1.18.20</version>
226                         </path>
227                         <path>
228                             <groupId>org.mapstruct</groupId>
229                             <artifactId>mapstruct-processor</artifactId>
230                             <version>${mapstruct.version}</version>
231                         </path>
232                     </annotationProcessorPaths>
233                 </configuration>
234             </plugin>
235             <plugin>
236                 <groupId>org.springframework.boot</groupId>
237                 <artifactId>spring-boot-maven-plugin</artifactId>
238                 <version>2.3.3.RELEASE</version>
239                 <executions>
240                     <execution>
241                         <goals>
242                             <goal>build-info</goal>
243                             <goal>repackage</goal>
244                         </goals>
245                     </execution>
246                 </executions>
247             </plugin>
248             <plugin>
249                 <!-- The gmavenplus plugin is used to compile Groovy code. To learn more about this plugin,
250                 visit https://github.com/groovy/GMavenPlus/wiki -->
251                 <groupId>org.codehaus.gmavenplus</groupId>
252                 <artifactId>gmavenplus-plugin</artifactId>
253                 <version>1.12.1</version>
254                 <executions>
255                     <execution>
256                         <goals>
257                             <goal>compile</goal>
258                             <goal>compileTests</goal>
259                         </goals>
260                     </execution>
261                 </executions>
262             </plugin>
263             <plugin>
264                 <groupId>org.apache.maven.plugins</groupId>
265                 <artifactId>maven-checkstyle-plugin</artifactId>
266                 <executions>
267                     <execution>
268                         <id>onap-license</id>
269                         <goals>
270                             <goal>check</goal>
271                         </goals>
272                         <phase>process-sources</phase>
273                         <configuration>
274                             <configLocation>onap-checkstyle/check-license.xml</configLocation>
275                             <includeResources>false</includeResources>
276                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
277                             <includeTestResources>false</includeTestResources>
278                             <sourceDirectories>
279                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
280                             </sourceDirectories>
281                             <consoleOutput>false</consoleOutput>
282                             <violationSeverity>warning</violationSeverity>
283                             <failOnViolation>true</failOnViolation>
284                         </configuration>
285                     </execution>
286                     <execution>
287                         <id>onap-java-style</id>
288                         <goals>
289                             <goal>check</goal>
290                         </goals>
291                         <phase>process-sources</phase>
292                         <configuration>
293                             <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
294                             <sourceDirectories>
295                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
296                             </sourceDirectories>
297                             <includeResources>true</includeResources>
298                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
299                             <includeTestResources>true</includeTestResources>
300                             <consoleOutput>false</consoleOutput>
301                             <violationSeverity>warning</violationSeverity>
302                             <failOnViolation>true</failOnViolation>
303                         </configuration>
304                     </execution>
305                     <execution>
306                         <id>cps-java-style</id>
307                         <goals>
308                             <goal>check</goal>
309                         </goals>
310                         <phase>process-sources</phase>
311                         <configuration>
312                             <configLocation>cps-java-style.xml</configLocation>
313                             <sourceDirectories>
314                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
315                             </sourceDirectories>
316                             <includeResources>true</includeResources>
317                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
318                             <includeTestResources>true</includeTestResources>
319                             <consoleOutput>true</consoleOutput>
320                             <violationSeverity>warning</violationSeverity>
321                             <failOnViolation>true</failOnViolation>
322                         </configuration>
323                     </execution>
324                 </executions>
325                 <dependencies>
326                     <dependency>
327                         <groupId>org.onap.oparent</groupId>
328                         <artifactId>checkstyle</artifactId>
329                         <version>3.2.0</version>
330                     </dependency>
331                     <dependency>
332                         <groupId>org.onap.cps</groupId>
333                         <artifactId>checkstyle</artifactId>
334                         <version>${cps.version}</version>
335                     </dependency>
336                 </dependencies>
337             </plugin>
338             <plugin>
339                 <groupId>com.github.spotbugs</groupId>
340                 <artifactId>spotbugs-maven-plugin</artifactId>
341                 <version>4.1.3</version>
342                 <dependencies>
343                     <dependency>
344                         <groupId>com.github.spotbugs</groupId>
345                         <artifactId>spotbugs</artifactId>
346                         <version>4.2.0</version>
347                     </dependency>
348                     <dependency>
349                         <groupId>org.onap.cps</groupId>
350                         <artifactId>spotbugs</artifactId>
351                         <version>${cps.version}</version>
352                     </dependency>
353                     <dependency>
354                         <!-- The SpotBugs Maven plugin uses SLF4J 1.8 beta 2 -->
355                         <groupId>org.slf4j</groupId>
356                         <artifactId>slf4j-simple</artifactId>
357                         <version>1.8.0-beta4</version>
358                     </dependency>
359                 </dependencies>
360                 <configuration>
361                     <plugins>
362                         <plugin>
363                             <groupId>jp.skypencil.findbugs.slf4j</groupId>
364                             <artifactId>bug-pattern</artifactId>
365                             <version>1.5.0</version>
366                         </plugin>
367                     </plugins>
368                     <!--
369                       Enables analysis which takes more memory but finds more bugs.
370                       If you run out of memory, changes the value of the effort element
371                       to 'Low'.
372                     -->
373                     <effort>Max</effort>
374                     <addSourceDirs>true</addSourceDirs>
375                     <!-- Reports all bugs (other values are medium and max) -->
376                     <threshold>Low</threshold>
377                     <!-- Build doesn't fail if problems are found -->
378                     <failOnError>true</failOnError>
379                     <!-- References the excluded rules -->
380                     <excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
381                     <!-- Produces XML report -->
382                     <xmlOutput>true</xmlOutput>
383                     <!-- Configures the directory in which the XML report is created -->
384                     <xmlOutputDirectory>${project.build.directory}/spotbugs</xmlOutputDirectory>
385                 </configuration>
386                 <executions>
387                     <!--
388                       Ensures that SpotBugs inspects source code when project is compiled.
389                     -->
390                     <execution>
391                         <id>analyze-compile</id>
392                         <phase>compile</phase>
393                         <goals>
394                             <goal>check</goal>
395                         </goals>
396                     </execution>
397                 </executions>
398             </plugin>
399             <plugin>
400                 <groupId>org.apache.maven.plugins</groupId>
401                 <artifactId>maven-surefire-plugin</artifactId>
402                 <configuration>
403                     <!--suppress UnresolvedMavenProperty -->
404                     <argLine>${surefireArgLine}</argLine>
405                     <useFile>false</useFile>
406                     <includes>
407                         <include>**/*Spec.java</include>
408                         <include>**/*Test.java</include>
409                     </includes>
410                     <environmentVariables>
411                         <!--
412                             Disable privileged container usage to cleanup the test containers;
413                             these are removed automatically on jvm termination;
414                             see https://www.testcontainers.org/features/configuration/#disabling-ryuk
415                         -->
416                         <TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
417                     </environmentVariables>
418                 </configuration>
419             </plugin>
420             <plugin>
421                 <groupId>org.jacoco</groupId>
422                 <artifactId>jacoco-maven-plugin</artifactId>
423                 <executions>
424                     <execution>
425                         <id>coverage-prepare-agent</id>
426                         <goals>
427                             <goal>prepare-agent</goal>
428                         </goals>
429                     </execution>
430                     <execution>
431                         <id>coverage-check</id>
432                         <goals>
433                             <goal>check</goal>
434                         </goals>
435                         <configuration>
436                             <excludes>
437                                 <exclude>org/onap/cps/temporal/controller/rest/model/*</exclude>
438                             </excludes>
439                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
440                             <rules>
441                                 <rule>
442                                     <element>BUNDLE</element>
443                                     <limits>
444                                         <limit>
445                                             <counter>INSTRUCTION</counter>
446                                             <value>COVEREDRATIO</value>
447                                             <minimum>${minimum-coverage}</minimum>
448                                         </limit>
449                                     </limits>
450                                 </rule>
451                             </rules>
452                         </configuration>
453                     </execution>
454                     <execution>
455                         <id>coverage-report</id>
456                         <goals>
457                             <goal>report</goal>
458                         </goals>
459                         <configuration>
460                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
461                         </configuration>
462                     </execution>
463                 </executions>
464             </plugin>
465             <plugin>
466                 <groupId>io.swagger.codegen.v3</groupId>
467                 <artifactId>swagger-codegen-maven-plugin</artifactId>
468                 <version>3.0.27</version>
469                 <executions>
470                     <execution>
471                         <goals>
472                             <goal>generate</goal>
473                         </goals>
474                         <configuration>
475                             <inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec>
476                             <invokerPackage>org.onap.cps.temporal.controller.rest</invokerPackage>
477                             <modelPackage>org.onap.cps.temporal.controller.rest.model</modelPackage>
478                             <apiPackage>org.onap.cps.temporal.controller.rest</apiPackage>
479                             <language>spring</language>
480                             <generateSupportingFiles>false</generateSupportingFiles>
481                             <configOptions>
482                                 <sourceFolder>src/gen/java</sourceFolder>
483                                 <dateLibrary>java11</dateLibrary>
484                                 <interfaceOnly>true</interfaceOnly>
485                                 <useTags>true</useTags>
486                             </configOptions>
487                         </configuration>
488                     </execution>
489                 </executions>
490             </plugin>
491         </plugins>
492
493        <pluginManagement>
494             <plugins>
495                 <plugin>
496                     <groupId>org.apache.maven.plugins</groupId>
497                     <artifactId>maven-surefire-plugin</artifactId>
498                     <version>3.0.0-M5</version>
499                 </plugin>
500                 <plugin>
501                     <groupId>com.google.cloud.tools</groupId>
502                     <artifactId>jib-maven-plugin</artifactId>
503                     <version>3.0.0</version>
504                     <configuration>
505                         <container>
506                             <mainClass>${app}</mainClass>
507                             <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
508                         </container>
509                         <from>
510                             <image>${image.base}</image>
511                         </from>
512                         <to>
513                             <tags>
514                                 <tag>latest</tag>
515                             </tags>
516                             <image>${image.name}:${project.version}-${maven.build.timestamp}</image>
517                         </to>
518                     </configuration>
519                     <executions>
520                         <execution>
521                             <phase>package</phase>
522                             <id>build</id>
523                             <goals>
524                                 <goal>dockerBuild</goal>
525                             </goals>
526                         </execution>
527                         <execution>
528                             <phase>deploy</phase>
529                             <id>buildAndPush</id>
530                             <goals>
531                                 <goal>build</goal>
532                             </goals>
533                         </execution>
534                     </executions>
535                 </plugin>
536             </plugins>
537         </pluginManagement>
538     </build>
539
540     <profiles>
541         <profile>
542             <id>docker</id>
543             <build>
544                 <plugins>
545                     <plugin>
546                         <groupId>com.google.cloud.tools</groupId>
547                         <artifactId>jib-maven-plugin</artifactId>
548                     </plugin>
549                 </plugins>
550             </build>
551         </profile>
552     </profiles>
553 </project>