blob: 00713605040e80a519a673864e5e024e07c9a732 [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 Gasparini13cc64d2020-12-02 18:47:09 +010023 <minimum-coverage>0.20</minimum-coverage>
Claudio David Gasparini24c217c2020-11-17 13:46:10 +010024 <nexusproxy>https://nexus.onap.org</nexusproxy>
25 <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
Claudio David Gasparini70c17022020-10-26 10:12:10 +010026 <oparent.version>3.1.0</oparent.version>
Claudio David Gasparini13cc64d2020-12-02 18:47:09 +010027 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Claudio David Gasparini24c217c2020-11-17 13:46:10 +010028 <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
Claudio David Gasparini900ba022020-11-08 22:18:36 +010029 <repository.name>nexus3.onap.org:10001/onap/cps-service</repository.name>
Claudio David Gasparini70c17022020-10-26 10:12:10 +010030 <spring-boot-maven-plugin.version>2.3.3.RELEASE</spring-boot-maven-plugin.version>
puthuparambil.aditya47598112020-11-02 11:31:39 +000031 <swagger-codegen-maven-plugin.version>3.0.18</swagger-codegen-maven-plugin.version>
Claudio David Gasparini24c217c2020-11-17 13:46:10 +010032 <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
33 <stagingNexusPath>/content/repositories/staging/</stagingNexusPath>
Claudio David Gasparini900ba022020-11-08 22:18:36 +010034 <tag.version>${project.version}</tag.version>
Claudio David Gasparini70c17022020-10-26 10:12:10 +010035 </properties>
36
Claudio David Gasparini24c217c2020-11-17 13:46:10 +010037 <distributionManagement>
38 <repository>
39 <id>ecomp-releases</id>
40 <name>ECOMP Release Repository</name>
41 <url>${nexusproxy}${releaseNexusPath}</url>
42 </repository>
43 <snapshotRepository>
44 <id>ecomp-snapshots</id>
45 <name>ECOMP Snapshot Repository</name>
46 <url>${nexusproxy}${snapshotNexusPath}</url>
47 </snapshotRepository>
48 </distributionManagement>
49
Claudio David Gasparini8710dc42020-11-16 17:37:15 +010050 <profiles>
51 <profile>
Claudio David Gasparini3ef227a2020-11-16 18:50:40 +010052 <id>docker</id>
Claudio David Gasparini8710dc42020-11-16 17:37:15 +010053 <activation>
54 <activeByDefault>false</activeByDefault>
55 </activation>
56 <build>
57 <pluginManagement>
58 <plugins>
59 <plugin>
60 <groupId>com.google.cloud.tools</groupId>
61 <artifactId>jib-maven-plugin</artifactId>
62 <version>${jib-maven-plugin.version}</version>
63 <configuration>
64 <container>
65 <mainClass>${app}</mainClass>
66 <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
67 </container>
68 <from>
69 <image>${base.image}</image>
70 </from>
71 <to>
72 <image>${repository.name}</image>
73 <tags>
74 <tag>${tag.version}</tag>
75 </tags>
76 </to>
77 </configuration>
78 <executions>
79 <execution>
80 <phase>package</phase>
81 <id>build</id>
82 <goals>
83 <goal>dockerBuild</goal>
84 </goals>
85 </execution>
86 <execution>
87 <phase>deploy</phase>
88 <id>buildAndPush</id>
89 <goals>
90 <goal>build</goal>
91 </goals>
92 </execution>
93 </executions>
94 </plugin>
95 </plugins>
96 </pluginManagement>
97 </build>
98 </profile>
Ruslan Kashapov7cca0292020-11-24 11:13:43 +020099 <profile>
100 <id>skip-db-tests</id>
101 <activation>
102 <!-- exclude module tests by default till Jenkins is configured to support test containers -->
103 <activeByDefault>true</activeByDefault>
104 </activation>
105 <build>
106 <plugins>
107 <plugin>
108 <groupId>org.apache.maven.plugins</groupId>
109 <artifactId>maven-surefire-plugin</artifactId>
110 <configuration>
111 <excludes>
112 <exclude>**/spi/impl/*Test.java</exclude>
113 </excludes>
114 </configuration>
115 </plugin>
116 </plugins>
117 </build>
118 </profile>
Claudio David Gasparini8710dc42020-11-16 17:37:15 +0100119 </profiles>
120
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100121 <dependencyManagement>
122 <dependencies>
123 <dependency>
124 <groupId>org.onap.cps</groupId>
125 <artifactId>cps-dependencies</artifactId>
126 <version>${project.version}</version>
127 <type>pom</type>
128 <scope>import</scope>
129 </dependency>
130 <dependency>
131 <groupId>org.onap.cps</groupId>
132 <artifactId>cps-bom</artifactId>
133 <version>${project.version}</version>
134 <type>pom</type>
135 <scope>import</scope>
136 </dependency>
137 </dependencies>
138 </dependencyManagement>
139
140 <build>
141 <resources>
142 <resource>
143 <directory>src/main/resources</directory>
144 <filtering>true</filtering>
145 </resource>
146 <resource>
147 <directory>target/generated-sources/license</directory>
148 <includes>
149 <include>third-party-licenses.txt</include>
150 </includes>
151 </resource>
152 <resource>
153 <directory>target/generated-resources/licenses</directory>
154 <includes>
155 <include>*.*</include>
156 </includes>
157 <targetPath>third-party-licenses</targetPath>
158 </resource>
159 </resources>
160 <pluginManagement>
161 <plugins>
162 <plugin>
163 <groupId>org.springframework.boot</groupId>
164 <artifactId>spring-boot-maven-plugin</artifactId>
165 <version>${spring-boot-maven-plugin.version}</version>
166 <executions>
167 <execution>
168 <goals>
Ruslan Kashapovf4d1c982020-10-29 11:39:31 +0200169 <goal>build-info</goal>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100170 <goal>repackage</goal>
171 </goals>
172 </execution>
173 </executions>
174 </plugin>
puthuparambil.aditya47598112020-11-02 11:31:39 +0000175 <!-- Swagger code generation. -->
176 <plugin>
177 <groupId>io.swagger.codegen.v3</groupId>
178 <artifactId>swagger-codegen-maven-plugin</artifactId>
179 <version>${swagger-codegen-maven-plugin.version}</version>
180 <executions>
181 <execution>
182 <goals>
183 <goal>generate</goal>
184 </goals>
185 <configuration>
186 <inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec>
187 <invokerPackage>org.onap.cps.rest.controller</invokerPackage>
188 <modelPackage>org.onap.cps.rest.model</modelPackage>
189 <apiPackage>org.onap.cps.rest.api</apiPackage>
190 <language>spring</language>
191 <generateSupportingFiles>false</generateSupportingFiles>
192 <configOptions>
193 <sourceFolder>src/gen/java</sourceFolder>
194 <dateLibrary>java11</dateLibrary>
195 <interfaceOnly>true</interfaceOnly>
196 <useTags>true</useTags>
197 </configOptions>
198 </configuration>
199 </execution>
200 </executions>
201 </plugin>
Claudio David Gasparini87c74a12020-11-18 08:38:01 +0100202 <plugin>
203 <groupId>com.google.cloud.tools</groupId>
204 <artifactId>jib-maven-plugin</artifactId>
205 <version>${jib-maven-plugin.version}</version>
206 <configuration>
207 <container>
208 <mainClass>${app}</mainClass>
209 <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
210 </container>
211 <from>
212 <image>${base.image}</image>
213 </from>
214 <to>
215 <image>${repository.name}</image>
216 <tags>
217 <tag>${tag.version}</tag>
218 </tags>
219 </to>
220 </configuration>
221 </plugin>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100222 </plugins>
223 </pluginManagement>
224 <plugins>
225 <plugin>
226 <groupId>org.apache.maven.plugins</groupId>
227 <artifactId>maven-compiler-plugin</artifactId>
228 <configuration>
229 <source>${java.version}</source>
230 <target>${java.version}</target>
231 </configuration>
232 </plugin>
233 <plugin>
234 <groupId>org.apache.maven.plugins</groupId>
235 <artifactId>maven-checkstyle-plugin</artifactId>
236 <executions>
237 <execution>
Claudio David Gasparini35b2b442020-12-01 14:53:40 +0100238 <id>onap-license</id>
239 <goals>
240 <goal>check</goal>
241 </goals>
242 <phase>process-sources</phase>
243 <configuration>
244 <configLocation>onap-checkstyle/check-license.xml</configLocation>
245 <includeResources>false</includeResources>
246 <includeTestSourceDirectory>true</includeTestSourceDirectory>
247 <includeTestResources>false</includeTestResources>
248 <sourceDirectories>
249 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
250 </sourceDirectories>
251 <consoleOutput>false</consoleOutput>
252 <violationSeverity>warning</violationSeverity>
253 <failOnViolation>true</failOnViolation>
254 </configuration>
255 </execution>
256 <execution>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100257 <id>onap-java-style</id>
258 <goals>
259 <goal>check</goal>
260 </goals>
261 <phase>process-sources</phase>
262 <configuration>
263 <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
Claudio David Gasparini35b2b442020-12-01 14:53:40 +0100264 <sourceDirectories>
265 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
266 </sourceDirectories>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100267 <includeResources>true</includeResources>
268 <includeTestSourceDirectory>true</includeTestSourceDirectory>
269 <includeTestResources>true</includeTestResources>
270 <consoleOutput>false</consoleOutput>
271 <violationSeverity>warning</violationSeverity>
272 <failOnViolation>true</failOnViolation>
273 </configuration>
274 </execution>
Claudio David Gasparini35b2b442020-12-01 14:53:40 +0100275 <execution>
276 <id>cps-java-style</id>
277 <goals>
278 <goal>check</goal>
279 </goals>
280 <phase>process-sources</phase>
281 <configuration>
282 <configLocation>cps-java-style.xml</configLocation>
283 <sourceDirectories>
284 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
285 </sourceDirectories>
286 <includeResources>true</includeResources>
287 <includeTestSourceDirectory>true</includeTestSourceDirectory>
288 <includeTestResources>true</includeTestResources>
289 <consoleOutput>true</consoleOutput>
290 <violationSeverity>warning</violationSeverity>
291 <failOnViolation>true</failOnViolation>
292 </configuration>
293 </execution>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100294 </executions>
295 <dependencies>
296 <dependency>
297 <groupId>org.onap.oparent</groupId>
298 <artifactId>checkstyle</artifactId>
299 <version>${oparent.version}</version>
300 </dependency>
Claudio David Gasparini35b2b442020-12-01 14:53:40 +0100301 <dependency>
302 <groupId>${project.groupId}</groupId>
303 <artifactId>checkstyle</artifactId>
304 <version>${project.version}</version>
305 </dependency>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100306 </dependencies>
307 </plugin>
308 <!-- Mandatory plugins for using Spock -->
309 <plugin>
310 <!-- The gmavenplus plugin is used to compile Groovy code.
311 To learn more about this plugin, visit https://github.com/groovy/GMavenPlus/wiki -->
312 <groupId>org.codehaus.gmavenplus</groupId>
313 <artifactId>gmavenplus-plugin</artifactId>
314 <version>1.9.0</version>
315 <executions>
316 <execution>
317 <goals>
318 <goal>compileTests</goal>
319 </goals>
320 </execution>
321 </executions>
322 </plugin>
323 <!-- Required because names of spec classes don't match default
324 Surefire patterns (`*Test` etc.) -->
325 <plugin>
326 <groupId>org.apache.maven.plugins</groupId>
327 <artifactId>maven-surefire-plugin</artifactId>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100328 <configuration>
Claudio David Gasparini13cc64d2020-12-02 18:47:09 +0100329 <argLine>${surefireArgLine}</argLine>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100330 <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>
Claudio David Gasparini13cc64d2020-12-02 18:47:09 +0100335 <excludes>
336 <exclude>**/IT*.java</exclude>
337 </excludes>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100338 </configuration>
339 </plugin>
Claudio David Gasparini900ba022020-11-08 22:18:36 +0100340 <plugin>
Claudio David Gasparini87c74a12020-11-18 08:38:01 +0100341 <groupId>org.jacoco</groupId>
342 <artifactId>jacoco-maven-plugin</artifactId>
Claudio David Gasparini87c74a12020-11-18 08:38:01 +0100343 <executions>
344 <execution>
345 <id>default-prepare-agent</id>
346 <goals>
347 <goal>prepare-agent</goal>
348 </goals>
349 </execution>
350 <execution>
351 <id>coverage-check</id>
352 <goals>
353 <goal>check</goal>
354 </goals>
355 <configuration>
Claudio David Gasparini13cc64d2020-12-02 18:47:09 +0100356 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
Claudio David Gasparini87c74a12020-11-18 08:38:01 +0100357 <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 </executions>
Claudio David Gasparini900ba022020-11-08 22:18:36 +0100372 </plugin>
Claudio David Gasparini70c17022020-10-26 10:12:10 +0100373 </plugins>
374 </build>
375</project>