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