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