blob: f427555aa1069889be3090f03ce584a25fcd23a1 [file] [log] [blame]
Claudio David Gasparini70c17022020-10-26 10:12:10 +01001<?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">
5 <parent>
6 <groupId>org.onap.oparent</groupId>
7 <artifactId>oparent</artifactId>
8 <version>3.1.0</version>
9 <relativePath/>
10 </parent>
11 <modelVersion>4.0.0</modelVersion>
12
13 <groupId>org.onap.cps</groupId>
14 <artifactId>cps-parent</artifactId>
15 <version>0.0.1-SNAPSHOT</version>
16 <packaging>pom</packaging>
17
18 <properties>
Claudio David Gasparini900ba022020-11-08 22:18:36 +010019 <app>org.onap.cps.Application</app>
20 <base.image>openjdk:11-jre-slim</base.image>
Claudio David Gasparini70c17022020-10-26 10:12:10 +010021 <java.version>11</java.version>
Claudio David Gasparini900ba022020-11-08 22:18:36 +010022 <jib-maven-plugin.version>2.6.0</jib-maven-plugin.version>
Claudio David Gasparini3e38d762021-01-15 14:08:34 +010023 <minimum-coverage>0.9</minimum-coverage>
Claudio David Gasparini24c217c2020-11-17 13:46:10 +010024 <nexusproxy>https://nexus.onap.org</nexusproxy>
Claudio David Gasparini70c17022020-10-26 10:12:10 +010025 <oparent.version>3.1.0</oparent.version>
Claudio David Gasparini13cc64d2020-12-02 18:47:09 +010026 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Claudio David Gasparini24c217c2020-11-17 13:46:10 +010027 <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
Claudio David Gasparini900ba022020-11-08 22:18:36 +010028 <repository.name>nexus3.onap.org:10001/onap/cps-service</repository.name>
Claudio David Gasparini9f93f792020-12-18 14:37:27 +010029 <spotbugs-maven-plugin.version>4.1.3</spotbugs-maven-plugin.version>
Claudio David Gasparini70c17022020-10-26 10:12:10 +010030 <spring-boot-maven-plugin.version>2.3.3.RELEASE</spring-boot-maven-plugin.version>
Claudio David Gasparini9f93f792020-12-18 14:37:27 +010031 <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>
puthuparambil.aditya47598112020-11-02 11:31:39 +000034 <swagger-codegen-maven-plugin.version>3.0.18</swagger-codegen-maven-plugin.version>
Claudio David Gasparini24c217c2020-11-17 13:46:10 +010035 <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
Claudio David Gasparini900ba022020-11-08 22:18:36 +010036 <tag.version>${project.version}</tag.version>
Claudio David Gasparinid45b2dc2021-01-13 13:28:07 +010037
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>
Claudio David Gasparini70c17022020-10-26 10:12:10 +010047 </properties>
48
Claudio David Gasparini24c217c2020-11-17 13:46:10 +010049 <distributionManagement>
50 <repository>
51 <id>ecomp-releases</id>
52 <name>ECOMP Release Repository</name>
53 <url>${nexusproxy}${releaseNexusPath}</url>
54 </repository>
55 <snapshotRepository>
56 <id>ecomp-snapshots</id>
57 <name>ECOMP Snapshot Repository</name>
58 <url>${nexusproxy}${snapshotNexusPath}</url>
59 </snapshotRepository>
60 </distributionManagement>
61
Claudio David Gasparini8710dc42020-11-16 17:37:15 +010062 <profiles>
63 <profile>
Claudio David Gasparini3ef227a2020-11-16 18:50:40 +010064 <id>docker</id>
Claudio David Gasparini8710dc42020-11-16 17:37:15 +010065 <activation>
66 <activeByDefault>false</activeByDefault>
67 </activation>
68 <build>
69 <pluginManagement>
70 <plugins>
71 <plugin>
72 <groupId>com.google.cloud.tools</groupId>
73 <artifactId>jib-maven-plugin</artifactId>
74 <version>${jib-maven-plugin.version}</version>
75 <configuration>
76 <container>
77 <mainClass>${app}</mainClass>
78 <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
79 </container>
80 <from>
81 <image>${base.image}</image>
82 </from>
83 <to>
84 <image>${repository.name}</image>
85 <tags>
86 <tag>${tag.version}</tag>
87 </tags>
88 </to>
89 </configuration>
90 <executions>
91 <execution>
92 <phase>package</phase>
93 <id>build</id>
94 <goals>
95 <goal>dockerBuild</goal>
96 </goals>
97 </execution>
98 <execution>
99 <phase>deploy</phase>
100 <id>buildAndPush</id>
101 <goals>
102 <goal>build</goal>
103 </goals>
104 </execution>
105 </executions>
106 </plugin>
107 </plugins>
108 </pluginManagement>
109 </build>
110 </profile>
111 </profiles>
112
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100113 <dependencyManagement>
114 <dependencies>
115 <dependency>
116 <groupId>org.onap.cps</groupId>
117 <artifactId>cps-dependencies</artifactId>
118 <version>${project.version}</version>
119 <type>pom</type>
120 <scope>import</scope>
121 </dependency>
122 <dependency>
123 <groupId>org.onap.cps</groupId>
124 <artifactId>cps-bom</artifactId>
125 <version>${project.version}</version>
126 <type>pom</type>
127 <scope>import</scope>
128 </dependency>
129 </dependencies>
130 </dependencyManagement>
131
132 <build>
133 <resources>
134 <resource>
135 <directory>src/main/resources</directory>
136 <filtering>true</filtering>
137 </resource>
138 <resource>
139 <directory>target/generated-sources/license</directory>
140 <includes>
141 <include>third-party-licenses.txt</include>
142 </includes>
143 </resource>
144 <resource>
145 <directory>target/generated-resources/licenses</directory>
146 <includes>
147 <include>*.*</include>
148 </includes>
149 <targetPath>third-party-licenses</targetPath>
150 </resource>
151 </resources>
152 <pluginManagement>
153 <plugins>
154 <plugin>
155 <groupId>org.springframework.boot</groupId>
156 <artifactId>spring-boot-maven-plugin</artifactId>
157 <version>${spring-boot-maven-plugin.version}</version>
158 <executions>
159 <execution>
160 <goals>
Ruslan Kashapovf4d1c982020-10-29 11:39:31 +0200161 <goal>build-info</goal>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100162 <goal>repackage</goal>
163 </goals>
164 </execution>
165 </executions>
166 </plugin>
puthuparambil.aditya47598112020-11-02 11:31:39 +0000167 <!-- Swagger code generation. -->
168 <plugin>
169 <groupId>io.swagger.codegen.v3</groupId>
170 <artifactId>swagger-codegen-maven-plugin</artifactId>
171 <version>${swagger-codegen-maven-plugin.version}</version>
172 <executions>
173 <execution>
174 <goals>
175 <goal>generate</goal>
176 </goals>
177 <configuration>
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>
184 <configOptions>
185 <sourceFolder>src/gen/java</sourceFolder>
186 <dateLibrary>java11</dateLibrary>
187 <interfaceOnly>true</interfaceOnly>
188 <useTags>true</useTags>
189 </configOptions>
190 </configuration>
191 </execution>
192 </executions>
193 </plugin>
Claudio David Gasparini87c74a12020-11-18 08:38:01 +0100194 <plugin>
195 <groupId>com.google.cloud.tools</groupId>
196 <artifactId>jib-maven-plugin</artifactId>
197 <version>${jib-maven-plugin.version}</version>
198 <configuration>
199 <container>
200 <mainClass>${app}</mainClass>
201 <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
202 </container>
203 <from>
204 <image>${base.image}</image>
205 </from>
206 <to>
207 <image>${repository.name}</image>
208 <tags>
209 <tag>${tag.version}</tag>
210 </tags>
211 </to>
212 </configuration>
213 </plugin>
Claudio David Gasparini9f93f792020-12-18 14:37:27 +0100214 <plugin>
215 <groupId>com.github.spotbugs</groupId>
216 <artifactId>spotbugs-maven-plugin</artifactId>
217 <version>${spotbugs-maven-plugin.version}</version>
218 <dependencies>
219 <dependency>
220 <groupId>com.github.spotbugs</groupId>
221 <artifactId>spotbugs</artifactId>
222 <version>${spotbugs.version}</version>
223 </dependency>
224 <dependency>
225 <groupId>${project.groupId}</groupId>
226 <artifactId>spotbugs</artifactId>
227 <version>${project.version}</version>
228 </dependency>
229 <dependency>
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>
234 </dependency>
235 </dependencies>
236 <configuration>
237 <plugins>
238 <plugin>
239 <groupId>jp.skypencil.findbugs.slf4j</groupId>
240 <artifactId>bug-pattern</artifactId>
241 <version>1.5.0</version>
242 </plugin>
243 </plugins>
244 <!--
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
247 to 'Low'.
248 -->
249 <effort>Max</effort>
250 <!-- Reports all bugs (other values are medium and max) -->
251 <threshold>Low</threshold>
252 <!-- Build doesn't fail if problems are found -->
Claudio David Gasparini9afc8d12021-01-11 16:42:30 +0100253 <failOnError>true</failOnError>
Claudio David Gasparini9f93f792020-12-18 14:37:27 +0100254 <!-- 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>
260 </configuration>
261 <executions>
262 <!--
263 Ensures that SpotBugs inspects source code when project is compiled.
264 -->
265 <execution>
266 <id>analyze-compile</id>
267 <phase>compile</phase>
268 <goals>
269 <goal>check</goal>
270 </goals>
271 </execution>
272 </executions>
273 </plugin>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100274 </plugins>
275 </pluginManagement>
276 <plugins>
277 <plugin>
278 <groupId>org.apache.maven.plugins</groupId>
279 <artifactId>maven-compiler-plugin</artifactId>
280 <configuration>
281 <source>${java.version}</source>
282 <target>${java.version}</target>
283 </configuration>
284 </plugin>
285 <plugin>
286 <groupId>org.apache.maven.plugins</groupId>
287 <artifactId>maven-checkstyle-plugin</artifactId>
288 <executions>
289 <execution>
Claudio David Gasparini35b2b442020-12-01 14:53:40 +0100290 <id>onap-license</id>
291 <goals>
292 <goal>check</goal>
293 </goals>
294 <phase>process-sources</phase>
295 <configuration>
296 <configLocation>onap-checkstyle/check-license.xml</configLocation>
297 <includeResources>false</includeResources>
298 <includeTestSourceDirectory>true</includeTestSourceDirectory>
299 <includeTestResources>false</includeTestResources>
300 <sourceDirectories>
301 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
302 </sourceDirectories>
303 <consoleOutput>false</consoleOutput>
304 <violationSeverity>warning</violationSeverity>
305 <failOnViolation>true</failOnViolation>
306 </configuration>
307 </execution>
308 <execution>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100309 <id>onap-java-style</id>
310 <goals>
311 <goal>check</goal>
312 </goals>
313 <phase>process-sources</phase>
314 <configuration>
315 <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
Claudio David Gasparini35b2b442020-12-01 14:53:40 +0100316 <sourceDirectories>
317 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
318 </sourceDirectories>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100319 <includeResources>true</includeResources>
320 <includeTestSourceDirectory>true</includeTestSourceDirectory>
321 <includeTestResources>true</includeTestResources>
322 <consoleOutput>false</consoleOutput>
323 <violationSeverity>warning</violationSeverity>
324 <failOnViolation>true</failOnViolation>
325 </configuration>
326 </execution>
Claudio David Gasparini35b2b442020-12-01 14:53:40 +0100327 <execution>
328 <id>cps-java-style</id>
329 <goals>
330 <goal>check</goal>
331 </goals>
332 <phase>process-sources</phase>
333 <configuration>
334 <configLocation>cps-java-style.xml</configLocation>
335 <sourceDirectories>
336 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
337 </sourceDirectories>
338 <includeResources>true</includeResources>
339 <includeTestSourceDirectory>true</includeTestSourceDirectory>
340 <includeTestResources>true</includeTestResources>
341 <consoleOutput>true</consoleOutput>
342 <violationSeverity>warning</violationSeverity>
343 <failOnViolation>true</failOnViolation>
344 </configuration>
345 </execution>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100346 </executions>
347 <dependencies>
348 <dependency>
349 <groupId>org.onap.oparent</groupId>
350 <artifactId>checkstyle</artifactId>
351 <version>${oparent.version}</version>
352 </dependency>
Claudio David Gasparini35b2b442020-12-01 14:53:40 +0100353 <dependency>
354 <groupId>${project.groupId}</groupId>
355 <artifactId>checkstyle</artifactId>
356 <version>${project.version}</version>
357 </dependency>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100358 </dependencies>
359 </plugin>
360 <!-- Mandatory plugins for using Spock -->
361 <plugin>
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>
367 <executions>
368 <execution>
369 <goals>
370 <goal>compileTests</goal>
371 </goals>
372 </execution>
373 </executions>
374 </plugin>
375 <!-- Required because names of spec classes don't match default
376 Surefire patterns (`*Test` etc.) -->
377 <plugin>
378 <groupId>org.apache.maven.plugins</groupId>
379 <artifactId>maven-surefire-plugin</artifactId>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100380 <configuration>
puthuparambil.aditya008c0ad2020-12-14 15:46:30 +0000381 <!--suppress UnresolvedMavenProperty -->
Claudio David Gasparini13cc64d2020-12-02 18:47:09 +0100382 <argLine>${surefireArgLine}</argLine>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100383 <useFile>false</useFile>
384 <includes>
385 <include>**/*Spec.java</include>
386 <include>**/*Test.java</include> <!-- Just in case of having also "normal" JUnit tests -->
387 </includes>
Claudio David Gasparini13cc64d2020-12-02 18:47:09 +0100388 <excludes>
389 <exclude>**/IT*.java</exclude>
390 </excludes>
Ruslan Kashapovbf02f202020-12-17 10:38:53 +0200391 <environmentVariables>
392 <!--
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
396 -->
397 <TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
398 </environmentVariables>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100399 </configuration>
400 </plugin>
Claudio David Gasparini900ba022020-11-08 22:18:36 +0100401 <plugin>
Claudio David Gasparini87c74a12020-11-18 08:38:01 +0100402 <groupId>org.jacoco</groupId>
403 <artifactId>jacoco-maven-plugin</artifactId>
Claudio David Gasparini87c74a12020-11-18 08:38:01 +0100404 <executions>
405 <execution>
406 <id>default-prepare-agent</id>
407 <goals>
408 <goal>prepare-agent</goal>
409 </goals>
410 </execution>
411 <execution>
412 <id>coverage-check</id>
413 <goals>
414 <goal>check</goal>
415 </goals>
416 <configuration>
puthuparambil.aditya008c0ad2020-12-14 15:46:30 +0000417 <excludes>
418 <exclude>org/onap/cps/rest/model/*</exclude>
419 </excludes>
Claudio David Gasparini13cc64d2020-12-02 18:47:09 +0100420 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
Claudio David Gasparini87c74a12020-11-18 08:38:01 +0100421 <rules>
422 <rule>
423 <element>BUNDLE</element>
424 <limits>
425 <limit>
426 <counter>INSTRUCTION</counter>
427 <value>COVEREDRATIO</value>
428 <minimum>${minimum-coverage}</minimum>
429 </limit>
430 </limits>
431 </rule>
432 </rules>
433 </configuration>
434 </execution>
Claudio David Gasparini593920b2021-01-13 13:47:18 +0100435 <execution>
436 <id>report</id>
437 <goals>
438 <goal>report-aggregate</goal>
439 </goals>
440 <phase>verify</phase>
441 <configuration>
442 <dataFileIncludes>
443 <fileInclude>**/code-coverage/jacoco-ut.exec</fileInclude>
444 </dataFileIncludes>
445 </configuration>
446 </execution>
Claudio David Gasparini87c74a12020-11-18 08:38:01 +0100447 </executions>
Claudio David Gasparini900ba022020-11-08 22:18:36 +0100448 </plugin>
Claudio David Gasparini9f93f792020-12-18 14:37:27 +0100449 <plugin>
450 <groupId>com.github.spotbugs</groupId>
451 <artifactId>spotbugs-maven-plugin</artifactId>
452 </plugin>
Claudio David Gasparini7492aea2021-01-13 08:34:00 +0100453 <plugin>
454 <groupId>org.sonarsource.scanner.maven</groupId>
455 <artifactId>sonar-maven-plugin</artifactId>
456 </plugin>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100457 </plugins>
458 </build>
459</project>