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