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