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