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