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