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