Update SpringBoot when approved version has Log4J 2.17.1 or higher
[cps.git] / cps-parent / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   ============LICENSE_START=======================================================
4   Copyright (c) 2021 Pantheon.tech.
5   Modifications Copyright (C) 2021 Bell Canada.
6   Modifications Copyright (C) 2021-2022 Nordix Foundation.
7   ================================================================================
8   Licensed under the Apache License, Version 2.0 (the "License");
9   you may not use this file except in compliance with the License.
10   You may obtain a copy of the License at
11
12         http://www.apache.org/licenses/LICENSE-2.0
13
14   Unless required by applicable law or agreed to in writing, software
15   distributed under the License is distributed on an "AS IS" BASIS,
16   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   See the License for the specific language governing permissions and
18   limitations under the License.
19   ============LICENSE_END=========================================================
20 -->
21
22 <project xmlns="http://maven.apache.org/POM/4.0.0"
23          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
25     <parent>
26         <groupId>org.onap.oparent</groupId>
27         <artifactId>oparent</artifactId>
28         <version>3.2.0</version>
29         <relativePath/>
30     </parent>
31     <modelVersion>4.0.0</modelVersion>
32
33     <groupId>org.onap.cps</groupId>
34     <artifactId>cps-parent</artifactId>
35     <version>3.1.0-SNAPSHOT</version>
36     <packaging>pom</packaging>
37
38     <properties>
39         <app>org.onap.cps.Application</app>
40         <java.version>11</java.version>
41         <minimum-coverage>0.97</minimum-coverage>
42
43         <jacoco.reportDirectory.aggregate>${project.reporting.outputDirectory}/jacoco-aggregate</jacoco.reportDirectory.aggregate>
44         <sonar.coverage.jacoco.xmlReportPaths>
45             ../jacoco-report/target/site/jacoco-aggregate/jacoco.xml
46         </sonar.coverage.jacoco.xmlReportPaths>
47     </properties>
48
49     <profiles>
50         <profile>
51             <id>Windows</id>
52             <activation>
53                 <os>
54                     <family>Windows</family>
55                 </os>
56             </activation>
57             <properties>
58                 <script.executor>python</script.executor>
59             </properties>
60         </profile>
61         <profile>
62             <id>unix</id>
63             <activation>
64                 <os>
65                     <family>unix</family>
66                 </os>
67             </activation>
68             <properties>
69                 <script.executor>python3</script.executor>
70             </properties>
71         </profile>
72     </profiles>
73
74     <dependencyManagement>
75         <dependencies>
76             <dependency>
77                 <groupId>org.onap.cps</groupId>
78                 <artifactId>cps-dependencies</artifactId>
79                 <version>${project.version}</version>
80                 <type>pom</type>
81                 <scope>import</scope>
82             </dependency>
83             <dependency>
84                 <groupId>org.onap.cps</groupId>
85                 <artifactId>cps-bom</artifactId>
86                 <version>${project.version}</version>
87                 <type>pom</type>
88                 <scope>import</scope>
89             </dependency>
90         </dependencies>
91     </dependencyManagement>
92
93     <build>
94         <resources>
95             <resource>
96                 <directory>src/main/resources</directory>
97                 <filtering>true</filtering>
98             </resource>
99             <resource>
100                 <directory>target/generated-sources/license</directory>
101                 <includes>
102                     <include>third-party-licenses.txt</include>
103                 </includes>
104             </resource>
105             <resource>
106                 <directory>target/generated-resources/licenses</directory>
107                 <includes>
108                     <include>*.*</include>
109                 </includes>
110                 <targetPath>third-party-licenses</targetPath>
111             </resource>
112         </resources>
113         <pluginManagement>
114             <plugins>
115                 <plugin>
116                     <groupId>org.springframework.boot</groupId>
117                     <artifactId>spring-boot-maven-plugin</artifactId>
118                     <version>2.6.4</version>
119                     <executions>
120                         <execution>
121                             <goals>
122                                 <goal>build-info</goal>
123                                 <goal>repackage</goal>
124                             </goals>
125                         </execution>
126                     </executions>
127                 </plugin>
128                 <plugin>
129                     <groupId>org.apache.maven.plugins</groupId>
130                     <artifactId>maven-surefire-plugin</artifactId>
131                     <version>3.0.0-M5</version>
132                 </plugin>
133                 <!-- Swagger code generation. -->
134                 <plugin>
135                     <groupId>io.swagger.codegen.v3</groupId>
136                     <artifactId>swagger-codegen-maven-plugin</artifactId>
137                     <version>3.0.27</version>
138                     <executions>
139                         <execution>
140                             <id>openapi-yaml-gen</id>
141                             <goals>
142                                 <goal>generate</goal>
143                             </goals>
144                             <phase>compile</phase>
145                             <configuration>
146                                 <inputSpec>${project.basedir}/docs/openapi/openapi.yml</inputSpec>
147                                 <language>openapi-yaml</language>
148                             </configuration>
149                         </execution>
150                     </executions>
151                 </plugin>
152                 <plugin>
153                     <groupId>com.github.spotbugs</groupId>
154                     <artifactId>spotbugs-maven-plugin</artifactId>
155                     <version>4.1.3</version>
156                     <dependencies>
157                         <dependency>
158                             <groupId>com.github.spotbugs</groupId>
159                             <artifactId>spotbugs</artifactId>
160                             <version>4.2.0</version>
161                         </dependency>
162                         <dependency>
163                             <groupId>${project.groupId}</groupId>
164                             <artifactId>spotbugs</artifactId>
165                             <version>${project.version}</version>
166                         </dependency>
167                         <dependency>
168                             <!-- The SpotBugs Maven plugin uses SLF4J 1.8 beta 2 -->
169                             <groupId>org.slf4j</groupId>
170                             <artifactId>slf4j-simple</artifactId>
171                             <version>1.8.0-beta4</version>
172                         </dependency>
173                     </dependencies>
174                     <configuration>
175                         <plugins>
176                             <plugin>
177                                 <groupId>jp.skypencil.findbugs.slf4j</groupId>
178                                 <artifactId>bug-pattern</artifactId>
179                                 <version>1.5.0</version>
180                             </plugin>
181                         </plugins>
182                         <!--
183                           Enables analysis which takes more memory but finds more bugs.
184                           If you run out of memory, changes the value of the effort element
185                           to 'Low'.
186                         -->
187                         <addSourceDirs>true</addSourceDirs>
188                         <effort>Max</effort>
189                         <!-- Reports all bugs (other values are medium and max) -->
190                         <threshold>Low</threshold>
191                         <!-- Build doesn't fail if problems are found -->
192                         <failOnError>true</failOnError>
193                         <!-- References the excluded rules -->
194                         <excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
195                         <!-- Produces XML report -->
196                         <xmlOutput>true</xmlOutput>
197                         <!-- Configures the directory in which the XML report is created -->
198                         <xmlOutputDirectory>${project.build.directory}/spotbugs</xmlOutputDirectory>
199                     </configuration>
200                     <executions>
201                         <!--
202                           Ensures that SpotBugs inspects source code when project is compiled.
203                         -->
204                         <execution>
205                             <id>analyze-compile</id>
206                             <phase>compile</phase>
207                             <goals>
208                                 <goal>check</goal>
209                             </goals>
210                         </execution>
211                     </executions>
212                 </plugin>
213                 <plugin>
214                     <groupId>org.jsonschema2pojo</groupId>
215                     <artifactId>jsonschema2pojo-maven-plugin</artifactId>
216                     <version>1.1.1</version>
217                     <configuration>
218                         <targetVersion>${java.version}</targetVersion>
219                     </configuration>
220                     <executions>
221                         <execution>
222                             <goals>
223                                 <goal>generate</goal>
224                             </goals>
225                         </execution>
226                     </executions>
227                 </plugin>
228             </plugins>
229         </pluginManagement>
230         <plugins>
231             <plugin>
232                 <groupId>org.apache.maven.plugins</groupId>
233                 <artifactId>maven-compiler-plugin</artifactId>
234                 <configuration>
235                     <source>${java.version}</source>
236                     <target>${java.version}</target>
237                 </configuration>
238             </plugin>
239             <plugin>
240                 <groupId>org.apache.maven.plugins</groupId>
241                 <artifactId>maven-checkstyle-plugin</artifactId>
242                 <executions>
243                     <execution>
244                         <id>onap-license</id>
245                         <goals>
246                             <goal>check</goal>
247                         </goals>
248                         <phase>process-sources</phase>
249                         <configuration>
250                             <configLocation>onap-checkstyle/check-license.xml</configLocation>
251                             <includeResources>false</includeResources>
252                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
253                             <includeTestResources>false</includeTestResources>
254                             <sourceDirectories>
255                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
256                             </sourceDirectories>
257                             <consoleOutput>false</consoleOutput>
258                             <violationSeverity>warning</violationSeverity>
259                             <failOnViolation>true</failOnViolation>
260                         </configuration>
261                     </execution>
262                     <execution>
263                         <id>onap-java-style</id>
264                         <goals>
265                             <goal>check</goal>
266                         </goals>
267                         <phase>process-sources</phase>
268                         <configuration>
269                             <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
270                             <sourceDirectories>
271                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
272                             </sourceDirectories>
273                             <includeResources>true</includeResources>
274                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
275                             <includeTestResources>true</includeTestResources>
276                             <consoleOutput>false</consoleOutput>
277                             <violationSeverity>warning</violationSeverity>
278                             <failOnViolation>true</failOnViolation>
279                         </configuration>
280                     </execution>
281                     <execution>
282                         <id>cps-java-style</id>
283                         <goals>
284                             <goal>check</goal>
285                         </goals>
286                         <phase>process-sources</phase>
287                         <configuration>
288                             <configLocation>cps-java-style.xml</configLocation>
289                             <sourceDirectories>
290                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
291                             </sourceDirectories>
292                             <includeResources>true</includeResources>
293                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
294                             <includeTestResources>true</includeTestResources>
295                             <consoleOutput>true</consoleOutput>
296                             <violationSeverity>warning</violationSeverity>
297                             <failOnViolation>true</failOnViolation>
298                         </configuration>
299                     </execution>
300                 </executions>
301                 <dependencies>
302                     <dependency>
303                         <groupId>org.onap.oparent</groupId>
304                         <artifactId>checkstyle</artifactId>
305                         <version>3.1.0</version>
306                     </dependency>
307                     <dependency>
308                         <groupId>${project.groupId}</groupId>
309                         <artifactId>checkstyle</artifactId>
310                         <version>${project.version}</version>
311                     </dependency>
312                 </dependencies>
313             </plugin>
314             <!-- Mandatory plugins for using Spock -->
315             <plugin>
316                 <!-- The gmavenplus plugin is used to compile Groovy code.
317                     To learn more about this plugin, visit https://github.com/groovy/GMavenPlus/wiki -->
318                 <groupId>org.codehaus.gmavenplus</groupId>
319                 <artifactId>gmavenplus-plugin</artifactId>
320                 <version>1.9.0</version>
321                 <executions>
322                     <execution>
323                         <goals>
324                             <goal>compileTests</goal>
325                         </goals>
326                     </execution>
327                 </executions>
328             </plugin>
329             <!-- Required because names of spec classes don't match default
330                 Surefire patterns (`*Test` etc.) -->
331             <plugin>
332                 <groupId>org.apache.maven.plugins</groupId>
333                 <artifactId>maven-surefire-plugin</artifactId>
334                 <configuration>
335                     <!--suppress UnresolvedMavenProperty -->
336                     <argLine>${surefireArgLine}</argLine>
337                     <useFile>false</useFile>
338                     <includes>
339                         <include>**/*Spec.java</include>
340                         <include>**/*Test.java</include> <!-- Just in case of having also "normal" JUnit tests -->
341                     </includes>
342                     <excludes>
343                         <exclude>**/IT*.java</exclude>
344                     </excludes>
345                     <environmentVariables>
346                         <!--
347                             disable privileged container usage to cleanup the test containers;
348                             these will be removed automatically on jvm termination;
349                             see https://www.testcontainers.org/features/configuration/#disabling-ryuk
350                          -->
351                         <TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
352                         <TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX>${docker.pull.registry}/</TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX>
353                     </environmentVariables>
354                 </configuration>
355             </plugin>
356             <plugin>
357                 <groupId>org.jacoco</groupId>
358                 <artifactId>jacoco-maven-plugin</artifactId>
359                 <configuration>
360                     <excludes>
361                         <exclude>org/onap/cps/event/model/*</exclude>
362                         <exclude>org/onap/cps/rest/model/*</exclude>
363                         <exclude>org/onap/cps/cpspath/parser/antlr4/*</exclude>
364                         <exclude>org/onap/cps/ncmp/rest/model/*</exclude>
365                     </excludes>
366                 </configuration>
367                 <executions>
368                     <execution>
369                         <id>default-prepare-agent</id>
370                         <goals>
371                             <goal>prepare-agent</goal>
372                         </goals>
373                     </execution>
374                     <execution>
375                         <id>coverage-check</id>
376                         <goals>
377                             <goal>check</goal>
378                         </goals>
379                         <configuration>
380                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
381                             <rules>
382                                 <rule>
383                                     <element>BUNDLE</element>
384                                     <limits>
385                                         <limit>
386                                             <counter>INSTRUCTION</counter>
387                                             <value>COVEREDRATIO</value>
388                                             <minimum>${minimum-coverage}</minimum>
389                                         </limit>
390                                     </limits>
391                                 </rule>
392                             </rules>
393                         </configuration>
394                     </execution>
395                 </executions>
396             </plugin>
397             <plugin>
398                 <groupId>com.github.spotbugs</groupId>
399                 <artifactId>spotbugs-maven-plugin</artifactId>
400             </plugin>
401             <plugin>
402                 <groupId>org.sonarsource.scanner.maven</groupId>
403                 <artifactId>sonar-maven-plugin</artifactId>
404             </plugin>
405             <plugin>
406                 <groupId>org.codehaus.mojo</groupId>
407                 <artifactId>exec-maven-plugin</artifactId>
408                 <version>1.6.0</version>
409                 <executions>
410                     <execution>
411                         <id>generate-csv</id>
412                         <phase>prepare-package</phase>
413                         <goals>
414                             <goal>exec</goal>
415                         </goals>
416                     </execution>
417                 </executions>
418                 <configuration>
419                     <executable>${script.executor}</executable>
420                     <workingDirectory>../cps-ri/src/main/resources/</workingDirectory>
421                     <arguments>
422                         <argument>yangResourceCsvGenerator.py</argument>
423                         <argument>dmi-registry@2021-12-13</argument>
424                         <argument>dmi-registry@2022-02-10</argument>
425                     </arguments>
426                 </configuration>
427             </plugin>
428         </plugins>
429     </build>
430 </project>