Initial cps-nf-proxy-rest module setup in CPS project
[cps.git] / cps-parent / pom.xml
1 <?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>
19         <app>org.onap.cps.Application</app>
20         <base.image>openjdk:11-jre-slim</base.image>
21         <java.version>11</java.version>
22         <jib-maven-plugin.version>2.6.0</jib-maven-plugin.version>
23         <minimum-coverage>0.9</minimum-coverage>
24         <nexusproxy>https://nexus.onap.org</nexusproxy>
25         <oparent.version>3.1.0</oparent.version>
26         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
27         <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
28         <repository.name>nexus3.onap.org:10001/onap/cps-service</repository.name>
29         <spotbugs-maven-plugin.version>4.1.3</spotbugs-maven-plugin.version>
30         <spring-boot-maven-plugin.version>2.3.3.RELEASE</spring-boot-maven-plugin.version>
31         <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>
34         <swagger-codegen-maven-plugin.version>3.0.18</swagger-codegen-maven-plugin.version>
35         <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
36         <tag.version>${project.version}</tag.version>
37
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             ../cps-nf-proxy-rest/target/site/jacoco-ut/jacoco.xml,
47             ../cps-nf-proxy-rest/target/site/jacoco-aggregate/jacoco.xml,
48         </sonar.coverage.jacoco.xmlReportPaths>
49     </properties>
50
51     <distributionManagement>
52         <repository>
53             <id>ecomp-releases</id>
54             <name>ECOMP Release Repository</name>
55             <url>${nexusproxy}${releaseNexusPath}</url>
56         </repository>
57         <snapshotRepository>
58             <id>ecomp-snapshots</id>
59             <name>ECOMP Snapshot Repository</name>
60             <url>${nexusproxy}${snapshotNexusPath}</url>
61         </snapshotRepository>
62     </distributionManagement>
63
64     <dependencyManagement>
65         <dependencies>
66             <dependency>
67                 <groupId>org.onap.cps</groupId>
68                 <artifactId>cps-dependencies</artifactId>
69                 <version>${project.version}</version>
70                 <type>pom</type>
71                 <scope>import</scope>
72             </dependency>
73             <dependency>
74                 <groupId>org.onap.cps</groupId>
75                 <artifactId>cps-bom</artifactId>
76                 <version>${project.version}</version>
77                 <type>pom</type>
78                 <scope>import</scope>
79             </dependency>
80         </dependencies>
81     </dependencyManagement>
82
83     <build>
84         <resources>
85             <resource>
86                 <directory>src/main/resources</directory>
87                 <filtering>true</filtering>
88             </resource>
89             <resource>
90                 <directory>target/generated-sources/license</directory>
91                 <includes>
92                     <include>third-party-licenses.txt</include>
93                 </includes>
94             </resource>
95             <resource>
96                 <directory>target/generated-resources/licenses</directory>
97                 <includes>
98                     <include>*.*</include>
99                 </includes>
100                 <targetPath>third-party-licenses</targetPath>
101             </resource>
102         </resources>
103         <pluginManagement>
104             <plugins>
105                 <plugin>
106                     <groupId>org.springframework.boot</groupId>
107                     <artifactId>spring-boot-maven-plugin</artifactId>
108                     <version>${spring-boot-maven-plugin.version}</version>
109                     <executions>
110                         <execution>
111                             <goals>
112                                 <goal>build-info</goal>
113                                 <goal>repackage</goal>
114                             </goals>
115                         </execution>
116                     </executions>
117                 </plugin>
118                 <!-- Swagger code generation. -->
119                 <plugin>
120                     <groupId>io.swagger.codegen.v3</groupId>
121                     <artifactId>swagger-codegen-maven-plugin</artifactId>
122                     <version>${swagger-codegen-maven-plugin.version}</version>
123                     <executions>
124                         <execution>
125                             <goals>
126                                 <goal>generate</goal>
127                             </goals>
128                             <configuration>
129                                 <inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec>
130                                 <invokerPackage>org.onap.cps.rest.controller</invokerPackage>
131                                 <modelPackage>org.onap.cps.rest.model</modelPackage>
132                                 <apiPackage>org.onap.cps.rest.api</apiPackage>
133                                 <language>spring</language>
134                                 <generateSupportingFiles>false</generateSupportingFiles>
135                                 <configOptions>
136                                     <sourceFolder>src/gen/java</sourceFolder>
137                                     <dateLibrary>java11</dateLibrary>
138                                     <interfaceOnly>true</interfaceOnly>
139                                     <useTags>true</useTags>
140                                 </configOptions>
141                             </configuration>
142                         </execution>
143                     </executions>
144                 </plugin>
145                 <plugin>
146                     <groupId>com.google.cloud.tools</groupId>
147                     <artifactId>jib-maven-plugin</artifactId>
148                     <version>${jib-maven-plugin.version}</version>
149                     <configuration>
150                         <container>
151                             <mainClass>${app}</mainClass>
152                             <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
153                         </container>
154                         <from>
155                             <image>${base.image}</image>
156                         </from>
157                         <to>
158                             <image>${repository.name}</image>
159                             <tags>
160                                 <tag>${tag.version}</tag>
161                             </tags>
162                         </to>
163                     </configuration>
164                 </plugin>
165                 <plugin>
166                     <groupId>com.github.spotbugs</groupId>
167                     <artifactId>spotbugs-maven-plugin</artifactId>
168                     <version>${spotbugs-maven-plugin.version}</version>
169                     <dependencies>
170                         <dependency>
171                             <groupId>com.github.spotbugs</groupId>
172                             <artifactId>spotbugs</artifactId>
173                             <version>${spotbugs.version}</version>
174                         </dependency>
175                         <dependency>
176                             <groupId>${project.groupId}</groupId>
177                             <artifactId>spotbugs</artifactId>
178                             <version>${project.version}</version>
179                         </dependency>
180                         <dependency>
181                             <!-- The SpotBugs Maven plugin uses SLF4J 1.8 beta 2 -->
182                             <groupId>org.slf4j</groupId>
183                             <artifactId>slf4j-simple</artifactId>
184                             <version>${spotbugs.slf4j.version}</version>
185                         </dependency>
186                     </dependencies>
187                     <configuration>
188                         <plugins>
189                             <plugin>
190                                 <groupId>jp.skypencil.findbugs.slf4j</groupId>
191                                 <artifactId>bug-pattern</artifactId>
192                                 <version>1.5.0</version>
193                             </plugin>
194                         </plugins>
195                         <!--
196                           Enables analysis which takes more memory but finds more bugs.
197                           If you run out of memory, changes the value of the effort element
198                           to 'Low'.
199                         -->
200                         <effort>Max</effort>
201                         <!-- Reports all bugs (other values are medium and max) -->
202                         <threshold>Low</threshold>
203                         <!-- Build doesn't fail if problems are found -->
204                         <failOnError>true</failOnError>
205                         <!-- References the excluded rules -->
206                         <excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
207                         <!-- Produces XML report -->
208                         <xmlOutput>true</xmlOutput>
209                         <!-- Configures the directory in which the XML report is created -->
210                         <xmlOutputDirectory>${project.build.directory}/spotbugs</xmlOutputDirectory>
211                     </configuration>
212                     <executions>
213                         <!--
214                           Ensures that SpotBugs inspects source code when project is compiled.
215                         -->
216                         <execution>
217                             <id>analyze-compile</id>
218                             <phase>compile</phase>
219                             <goals>
220                                 <goal>check</goal>
221                             </goals>
222                         </execution>
223                     </executions>
224                 </plugin>
225             </plugins>
226         </pluginManagement>
227         <plugins>
228             <plugin>
229                 <groupId>org.apache.maven.plugins</groupId>
230                 <artifactId>maven-compiler-plugin</artifactId>
231                 <configuration>
232                     <source>${java.version}</source>
233                     <target>${java.version}</target>
234                 </configuration>
235             </plugin>
236             <plugin>
237                 <groupId>org.apache.maven.plugins</groupId>
238                 <artifactId>maven-checkstyle-plugin</artifactId>
239                 <executions>
240                     <execution>
241                         <id>onap-license</id>
242                         <goals>
243                             <goal>check</goal>
244                         </goals>
245                         <phase>process-sources</phase>
246                         <configuration>
247                             <configLocation>onap-checkstyle/check-license.xml</configLocation>
248                             <includeResources>false</includeResources>
249                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
250                             <includeTestResources>false</includeTestResources>
251                             <sourceDirectories>
252                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
253                             </sourceDirectories>
254                             <consoleOutput>false</consoleOutput>
255                             <violationSeverity>warning</violationSeverity>
256                             <failOnViolation>true</failOnViolation>
257                         </configuration>
258                     </execution>
259                     <execution>
260                         <id>onap-java-style</id>
261                         <goals>
262                             <goal>check</goal>
263                         </goals>
264                         <phase>process-sources</phase>
265                         <configuration>
266                             <configLocation>onap-checkstyle/onap-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>false</consoleOutput>
274                             <violationSeverity>warning</violationSeverity>
275                             <failOnViolation>true</failOnViolation>
276                         </configuration>
277                     </execution>
278                     <execution>
279                         <id>cps-java-style</id>
280                         <goals>
281                             <goal>check</goal>
282                         </goals>
283                         <phase>process-sources</phase>
284                         <configuration>
285                             <configLocation>cps-java-style.xml</configLocation>
286                             <sourceDirectories>
287                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
288                             </sourceDirectories>
289                             <includeResources>true</includeResources>
290                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
291                             <includeTestResources>true</includeTestResources>
292                             <consoleOutput>true</consoleOutput>
293                             <violationSeverity>warning</violationSeverity>
294                             <failOnViolation>true</failOnViolation>
295                         </configuration>
296                     </execution>
297                 </executions>
298                 <dependencies>
299                     <dependency>
300                         <groupId>org.onap.oparent</groupId>
301                         <artifactId>checkstyle</artifactId>
302                         <version>${oparent.version}</version>
303                     </dependency>
304                     <dependency>
305                         <groupId>${project.groupId}</groupId>
306                         <artifactId>checkstyle</artifactId>
307                         <version>${project.version}</version>
308                     </dependency>
309                 </dependencies>
310             </plugin>
311             <!-- Mandatory plugins for using Spock -->
312             <plugin>
313                 <!-- The gmavenplus plugin is used to compile Groovy code.
314                     To learn more about this plugin, visit https://github.com/groovy/GMavenPlus/wiki -->
315                 <groupId>org.codehaus.gmavenplus</groupId>
316                 <artifactId>gmavenplus-plugin</artifactId>
317                 <version>1.9.0</version>
318                 <executions>
319                     <execution>
320                         <goals>
321                             <goal>compileTests</goal>
322                         </goals>
323                     </execution>
324                 </executions>
325             </plugin>
326             <!-- Required because names of spec classes don't match default
327                 Surefire patterns (`*Test` etc.) -->
328             <plugin>
329                 <groupId>org.apache.maven.plugins</groupId>
330                 <artifactId>maven-surefire-plugin</artifactId>
331                 <configuration>
332                     <!--suppress UnresolvedMavenProperty -->
333                     <argLine>${surefireArgLine}</argLine>
334                     <useFile>false</useFile>
335                     <includes>
336                         <include>**/*Spec.java</include>
337                         <include>**/*Test.java</include> <!-- Just in case of having also "normal" JUnit tests -->
338                     </includes>
339                     <excludes>
340                         <exclude>**/IT*.java</exclude>
341                     </excludes>
342                     <environmentVariables>
343                         <!--
344                             disable privileged container usage to cleanup the test containers;
345                             these will be removed automatically on jvm termination;
346                             see https://www.testcontainers.org/features/configuration/#disabling-ryuk
347                          -->
348                         <TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
349                     </environmentVariables>
350                 </configuration>
351             </plugin>
352             <plugin>
353                 <groupId>org.jacoco</groupId>
354                 <artifactId>jacoco-maven-plugin</artifactId>
355                 <executions>
356                     <execution>
357                         <id>default-prepare-agent</id>
358                         <goals>
359                             <goal>prepare-agent</goal>
360                         </goals>
361                     </execution>
362                     <execution>
363                         <id>coverage-check</id>
364                         <goals>
365                             <goal>check</goal>
366                         </goals>
367                         <configuration>
368                             <excludes>
369                                 <exclude>org/onap/cps/rest/model/*</exclude>
370                             </excludes>
371                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
372                             <rules>
373                                 <rule>
374                                     <element>BUNDLE</element>
375                                     <limits>
376                                         <limit>
377                                             <counter>INSTRUCTION</counter>
378                                             <value>COVEREDRATIO</value>
379                                             <minimum>${minimum-coverage}</minimum>
380                                         </limit>
381                                     </limits>
382                                 </rule>
383                             </rules>
384                         </configuration>
385                     </execution>
386                     <execution>
387                         <id>report</id>
388                         <goals>
389                             <goal>report-aggregate</goal>
390                         </goals>
391                         <phase>verify</phase>
392                         <configuration>
393                             <dataFileIncludes>
394                                 <fileInclude>**/code-coverage/jacoco-ut.exec</fileInclude>
395                             </dataFileIncludes>
396                         </configuration>
397                     </execution>
398                 </executions>
399             </plugin>
400             <plugin>
401                 <groupId>com.github.spotbugs</groupId>
402                 <artifactId>spotbugs-maven-plugin</artifactId>
403             </plugin>
404             <plugin>
405                 <groupId>org.sonarsource.scanner.maven</groupId>
406                 <artifactId>sonar-maven-plugin</artifactId>
407             </plugin>
408         </plugins>
409     </build>
410 </project>