1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
6 <groupId>org.onap.oparent</groupId>
7 <artifactId>oparent</artifactId>
8 <version>3.1.0</version>
11 <modelVersion>4.0.0</modelVersion>
13 <groupId>org.onap.cps</groupId>
14 <artifactId>cps-parent</artifactId>
15 <version>0.0.1-SNAPSHOT</version>
16 <packaging>pom</packaging>
19 <app>org.onap.cps.Application</app>
20 <base.image>openjdk:11-jre-slim</base.image>
21 <java.version>11</java.version>
22 <jib-maven-plugin.version>2.6.0</jib-maven-plugin.version>
23 <minimum-coverage>0.80</minimum-coverage>
24 <nexusproxy>https://nexus.onap.org</nexusproxy>
25 <oparent.version>3.1.0</oparent.version>
26 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
27 <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
28 <repository.name>nexus3.onap.org:10001/onap/cps-service</repository.name>
29 <spotbugs-maven-plugin.version>4.1.3</spotbugs-maven-plugin.version>
30 <spring-boot-maven-plugin.version>2.3.3.RELEASE</spring-boot-maven-plugin.version>
31 <spotbugs.slf4j.version>1.8.0-beta4</spotbugs.slf4j.version>
32 <spotbugs.bug-pattern.version>1.5.0</spotbugs.bug-pattern.version>
33 <spotbugs.version>4.2.0</spotbugs.version>
34 <swagger-codegen-maven-plugin.version>3.0.18</swagger-codegen-maven-plugin.version>
35 <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
36 <tag.version>${project.version}</tag.version>
38 <jacoco.reportDirectory.aggregate>${project.reporting.outputDirectory}/jacoco-aggregate</jacoco.reportDirectory.aggregate>
39 <sonar.coverage.jacoco.xmlReportPaths>
40 ../cps-ri/target/site/jacoco-ut/jacoco.xml,
41 ../cps-ri/target/site/jacoco-aggregate/jacoco.xml,
42 ../cps-service/target/site/jacoco-ut/jacoco.xml,
43 ../cps-service/target/site/jacoco-aggregate/jacoco.xml,
44 ../cps-rest/target/site/jacoco-ut/jacoco.xml,
45 ../cps-rest/target/site/jacoco-aggregate/jacoco.xml,
46 </sonar.coverage.jacoco.xmlReportPaths>
49 <distributionManagement>
51 <id>ecomp-releases</id>
52 <name>ECOMP Release Repository</name>
53 <url>${nexusproxy}${releaseNexusPath}</url>
56 <id>ecomp-snapshots</id>
57 <name>ECOMP Snapshot Repository</name>
58 <url>${nexusproxy}${snapshotNexusPath}</url>
60 </distributionManagement>
66 <activeByDefault>false</activeByDefault>
72 <groupId>com.google.cloud.tools</groupId>
73 <artifactId>jib-maven-plugin</artifactId>
74 <version>${jib-maven-plugin.version}</version>
77 <mainClass>${app}</mainClass>
78 <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
81 <image>${base.image}</image>
84 <image>${repository.name}</image>
86 <tag>${tag.version}</tag>
92 <phase>package</phase>
95 <goal>dockerBuild</goal>
100 <id>buildAndPush</id>
113 <dependencyManagement>
116 <groupId>org.onap.cps</groupId>
117 <artifactId>cps-dependencies</artifactId>
118 <version>${project.version}</version>
120 <scope>import</scope>
123 <groupId>org.onap.cps</groupId>
124 <artifactId>cps-bom</artifactId>
125 <version>${project.version}</version>
127 <scope>import</scope>
130 </dependencyManagement>
135 <directory>src/main/resources</directory>
136 <filtering>true</filtering>
139 <directory>target/generated-sources/license</directory>
141 <include>third-party-licenses.txt</include>
145 <directory>target/generated-resources/licenses</directory>
147 <include>*.*</include>
149 <targetPath>third-party-licenses</targetPath>
155 <groupId>org.springframework.boot</groupId>
156 <artifactId>spring-boot-maven-plugin</artifactId>
157 <version>${spring-boot-maven-plugin.version}</version>
161 <goal>build-info</goal>
162 <goal>repackage</goal>
167 <!-- Swagger code generation. -->
169 <groupId>io.swagger.codegen.v3</groupId>
170 <artifactId>swagger-codegen-maven-plugin</artifactId>
171 <version>${swagger-codegen-maven-plugin.version}</version>
175 <goal>generate</goal>
178 <inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec>
179 <invokerPackage>org.onap.cps.rest.controller</invokerPackage>
180 <modelPackage>org.onap.cps.rest.model</modelPackage>
181 <apiPackage>org.onap.cps.rest.api</apiPackage>
182 <language>spring</language>
183 <generateSupportingFiles>false</generateSupportingFiles>
185 <sourceFolder>src/gen/java</sourceFolder>
186 <dateLibrary>java11</dateLibrary>
187 <interfaceOnly>true</interfaceOnly>
188 <useTags>true</useTags>
195 <groupId>com.google.cloud.tools</groupId>
196 <artifactId>jib-maven-plugin</artifactId>
197 <version>${jib-maven-plugin.version}</version>
200 <mainClass>${app}</mainClass>
201 <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
204 <image>${base.image}</image>
207 <image>${repository.name}</image>
209 <tag>${tag.version}</tag>
215 <groupId>com.github.spotbugs</groupId>
216 <artifactId>spotbugs-maven-plugin</artifactId>
217 <version>${spotbugs-maven-plugin.version}</version>
220 <groupId>com.github.spotbugs</groupId>
221 <artifactId>spotbugs</artifactId>
222 <version>${spotbugs.version}</version>
225 <groupId>${project.groupId}</groupId>
226 <artifactId>spotbugs</artifactId>
227 <version>${project.version}</version>
230 <!-- The SpotBugs Maven plugin uses SLF4J 1.8 beta 2 -->
231 <groupId>org.slf4j</groupId>
232 <artifactId>slf4j-simple</artifactId>
233 <version>${spotbugs.slf4j.version}</version>
239 <groupId>jp.skypencil.findbugs.slf4j</groupId>
240 <artifactId>bug-pattern</artifactId>
241 <version>1.5.0</version>
245 Enables analysis which takes more memory but finds more bugs.
246 If you run out of memory, changes the value of the effort element
250 <!-- Reports all bugs (other values are medium and max) -->
251 <threshold>Low</threshold>
252 <!-- Build doesn't fail if problems are found -->
253 <failOnError>true</failOnError>
254 <!-- References the excluded rules -->
255 <excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
256 <!-- Produces XML report -->
257 <xmlOutput>true</xmlOutput>
258 <!-- Configures the directory in which the XML report is created -->
259 <xmlOutputDirectory>${project.build.directory}/spotbugs</xmlOutputDirectory>
263 Ensures that SpotBugs inspects source code when project is compiled.
266 <id>analyze-compile</id>
267 <phase>compile</phase>
278 <groupId>org.apache.maven.plugins</groupId>
279 <artifactId>maven-compiler-plugin</artifactId>
281 <source>${java.version}</source>
282 <target>${java.version}</target>
286 <groupId>org.apache.maven.plugins</groupId>
287 <artifactId>maven-checkstyle-plugin</artifactId>
290 <id>onap-license</id>
294 <phase>process-sources</phase>
296 <configLocation>onap-checkstyle/check-license.xml</configLocation>
297 <includeResources>false</includeResources>
298 <includeTestSourceDirectory>true</includeTestSourceDirectory>
299 <includeTestResources>false</includeTestResources>
301 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
303 <consoleOutput>false</consoleOutput>
304 <violationSeverity>warning</violationSeverity>
305 <failOnViolation>true</failOnViolation>
309 <id>onap-java-style</id>
313 <phase>process-sources</phase>
315 <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
317 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
319 <includeResources>true</includeResources>
320 <includeTestSourceDirectory>true</includeTestSourceDirectory>
321 <includeTestResources>true</includeTestResources>
322 <consoleOutput>false</consoleOutput>
323 <violationSeverity>warning</violationSeverity>
324 <failOnViolation>true</failOnViolation>
328 <id>cps-java-style</id>
332 <phase>process-sources</phase>
334 <configLocation>cps-java-style.xml</configLocation>
336 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
338 <includeResources>true</includeResources>
339 <includeTestSourceDirectory>true</includeTestSourceDirectory>
340 <includeTestResources>true</includeTestResources>
341 <consoleOutput>true</consoleOutput>
342 <violationSeverity>warning</violationSeverity>
343 <failOnViolation>true</failOnViolation>
349 <groupId>org.onap.oparent</groupId>
350 <artifactId>checkstyle</artifactId>
351 <version>${oparent.version}</version>
354 <groupId>${project.groupId}</groupId>
355 <artifactId>checkstyle</artifactId>
356 <version>${project.version}</version>
360 <!-- Mandatory plugins for using Spock -->
362 <!-- The gmavenplus plugin is used to compile Groovy code.
363 To learn more about this plugin, visit https://github.com/groovy/GMavenPlus/wiki -->
364 <groupId>org.codehaus.gmavenplus</groupId>
365 <artifactId>gmavenplus-plugin</artifactId>
366 <version>1.9.0</version>
370 <goal>compileTests</goal>
375 <!-- Required because names of spec classes don't match default
376 Surefire patterns (`*Test` etc.) -->
378 <groupId>org.apache.maven.plugins</groupId>
379 <artifactId>maven-surefire-plugin</artifactId>
381 <!--suppress UnresolvedMavenProperty -->
382 <argLine>${surefireArgLine}</argLine>
383 <useFile>false</useFile>
385 <include>**/*Spec.java</include>
386 <include>**/*Test.java</include> <!-- Just in case of having also "normal" JUnit tests -->
389 <exclude>**/IT*.java</exclude>
391 <environmentVariables>
393 disable privileged container usage to cleanup the test containers;
394 these will be removed automatically on jvm termination;
395 see https://www.testcontainers.org/features/configuration/#disabling-ryuk
397 <TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
398 </environmentVariables>
402 <groupId>org.jacoco</groupId>
403 <artifactId>jacoco-maven-plugin</artifactId>
406 <id>default-prepare-agent</id>
408 <goal>prepare-agent</goal>
412 <id>coverage-check</id>
418 <exclude>org/onap/cps/rest/model/*</exclude>
420 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
423 <element>BUNDLE</element>
426 <counter>INSTRUCTION</counter>
427 <value>COVEREDRATIO</value>
428 <minimum>${minimum-coverage}</minimum>
438 <goal>report-aggregate</goal>
440 <phase>verify</phase>
443 <fileInclude>**/code-coverage/jacoco-ut.exec</fileInclude>
450 <groupId>com.github.spotbugs</groupId>
451 <artifactId>spotbugs-maven-plugin</artifactId>
454 <groupId>org.sonarsource.scanner.maven</groupId>
455 <artifactId>sonar-maven-plugin</artifactId>