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