Merge "ZIP archive support for multiple YANG files delivery on Schema Set creation...
[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         </sonar.coverage.jacoco.xmlReportPaths>
47     </properties>
48
49     <distributionManagement>
50         <repository>
51             <id>ecomp-releases</id>
52             <name>ECOMP Release Repository</name>
53             <url>${nexusproxy}${releaseNexusPath}</url>
54         </repository>
55         <snapshotRepository>
56             <id>ecomp-snapshots</id>
57             <name>ECOMP Snapshot Repository</name>
58             <url>${nexusproxy}${snapshotNexusPath}</url>
59         </snapshotRepository>
60     </distributionManagement>
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>${spring-boot-maven-plugin.version}</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>${swagger-codegen-maven-plugin.version}</version>
121                     <executions>
122                         <execution>
123                             <goals>
124                                 <goal>generate</goal>
125                             </goals>
126                             <configuration>
127                                 <inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec>
128                                 <invokerPackage>org.onap.cps.rest.controller</invokerPackage>
129                                 <modelPackage>org.onap.cps.rest.model</modelPackage>
130                                 <apiPackage>org.onap.cps.rest.api</apiPackage>
131                                 <language>spring</language>
132                                 <generateSupportingFiles>false</generateSupportingFiles>
133                                 <configOptions>
134                                     <sourceFolder>src/gen/java</sourceFolder>
135                                     <dateLibrary>java11</dateLibrary>
136                                     <interfaceOnly>true</interfaceOnly>
137                                     <useTags>true</useTags>
138                                 </configOptions>
139                             </configuration>
140                         </execution>
141                     </executions>
142                 </plugin>
143                 <plugin>
144                     <groupId>com.google.cloud.tools</groupId>
145                     <artifactId>jib-maven-plugin</artifactId>
146                     <version>${jib-maven-plugin.version}</version>
147                     <configuration>
148                         <container>
149                             <mainClass>${app}</mainClass>
150                             <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
151                         </container>
152                         <from>
153                             <image>${base.image}</image>
154                         </from>
155                         <to>
156                             <image>${repository.name}</image>
157                             <tags>
158                                 <tag>${tag.version}</tag>
159                             </tags>
160                         </to>
161                     </configuration>
162                 </plugin>
163                 <plugin>
164                     <groupId>com.github.spotbugs</groupId>
165                     <artifactId>spotbugs-maven-plugin</artifactId>
166                     <version>${spotbugs-maven-plugin.version}</version>
167                     <dependencies>
168                         <dependency>
169                             <groupId>com.github.spotbugs</groupId>
170                             <artifactId>spotbugs</artifactId>
171                             <version>${spotbugs.version}</version>
172                         </dependency>
173                         <dependency>
174                             <groupId>${project.groupId}</groupId>
175                             <artifactId>spotbugs</artifactId>
176                             <version>${project.version}</version>
177                         </dependency>
178                         <dependency>
179                             <!-- The SpotBugs Maven plugin uses SLF4J 1.8 beta 2 -->
180                             <groupId>org.slf4j</groupId>
181                             <artifactId>slf4j-simple</artifactId>
182                             <version>${spotbugs.slf4j.version}</version>
183                         </dependency>
184                     </dependencies>
185                     <configuration>
186                         <plugins>
187                             <plugin>
188                                 <groupId>jp.skypencil.findbugs.slf4j</groupId>
189                                 <artifactId>bug-pattern</artifactId>
190                                 <version>1.5.0</version>
191                             </plugin>
192                         </plugins>
193                         <!--
194                           Enables analysis which takes more memory but finds more bugs.
195                           If you run out of memory, changes the value of the effort element
196                           to 'Low'.
197                         -->
198                         <effort>Max</effort>
199                         <!-- Reports all bugs (other values are medium and max) -->
200                         <threshold>Low</threshold>
201                         <!-- Build doesn't fail if problems are found -->
202                         <failOnError>true</failOnError>
203                         <!-- References the excluded rules -->
204                         <excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
205                         <!-- Produces XML report -->
206                         <xmlOutput>true</xmlOutput>
207                         <!-- Configures the directory in which the XML report is created -->
208                         <xmlOutputDirectory>${project.build.directory}/spotbugs</xmlOutputDirectory>
209                     </configuration>
210                     <executions>
211                         <!--
212                           Ensures that SpotBugs inspects source code when project is compiled.
213                         -->
214                         <execution>
215                             <id>analyze-compile</id>
216                             <phase>compile</phase>
217                             <goals>
218                                 <goal>check</goal>
219                             </goals>
220                         </execution>
221                     </executions>
222                 </plugin>
223             </plugins>
224         </pluginManagement>
225         <plugins>
226             <plugin>
227                 <groupId>org.apache.maven.plugins</groupId>
228                 <artifactId>maven-compiler-plugin</artifactId>
229                 <configuration>
230                     <source>${java.version}</source>
231                     <target>${java.version}</target>
232                 </configuration>
233             </plugin>
234             <plugin>
235                 <groupId>org.apache.maven.plugins</groupId>
236                 <artifactId>maven-checkstyle-plugin</artifactId>
237                 <executions>
238                     <execution>
239                         <id>onap-license</id>
240                         <goals>
241                             <goal>check</goal>
242                         </goals>
243                         <phase>process-sources</phase>
244                         <configuration>
245                             <configLocation>onap-checkstyle/check-license.xml</configLocation>
246                             <includeResources>false</includeResources>
247                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
248                             <includeTestResources>false</includeTestResources>
249                             <sourceDirectories>
250                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
251                             </sourceDirectories>
252                             <consoleOutput>false</consoleOutput>
253                             <violationSeverity>warning</violationSeverity>
254                             <failOnViolation>true</failOnViolation>
255                         </configuration>
256                     </execution>
257                     <execution>
258                         <id>onap-java-style</id>
259                         <goals>
260                             <goal>check</goal>
261                         </goals>
262                         <phase>process-sources</phase>
263                         <configuration>
264                             <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
265                             <sourceDirectories>
266                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
267                             </sourceDirectories>
268                             <includeResources>true</includeResources>
269                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
270                             <includeTestResources>true</includeTestResources>
271                             <consoleOutput>false</consoleOutput>
272                             <violationSeverity>warning</violationSeverity>
273                             <failOnViolation>true</failOnViolation>
274                         </configuration>
275                     </execution>
276                     <execution>
277                         <id>cps-java-style</id>
278                         <goals>
279                             <goal>check</goal>
280                         </goals>
281                         <phase>process-sources</phase>
282                         <configuration>
283                             <configLocation>cps-java-style.xml</configLocation>
284                             <sourceDirectories>
285                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
286                             </sourceDirectories>
287                             <includeResources>true</includeResources>
288                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
289                             <includeTestResources>true</includeTestResources>
290                             <consoleOutput>true</consoleOutput>
291                             <violationSeverity>warning</violationSeverity>
292                             <failOnViolation>true</failOnViolation>
293                         </configuration>
294                     </execution>
295                 </executions>
296                 <dependencies>
297                     <dependency>
298                         <groupId>org.onap.oparent</groupId>
299                         <artifactId>checkstyle</artifactId>
300                         <version>${oparent.version}</version>
301                     </dependency>
302                     <dependency>
303                         <groupId>${project.groupId}</groupId>
304                         <artifactId>checkstyle</artifactId>
305                         <version>${project.version}</version>
306                     </dependency>
307                 </dependencies>
308             </plugin>
309             <!-- Mandatory plugins for using Spock -->
310             <plugin>
311                 <!-- The gmavenplus plugin is used to compile Groovy code.
312                     To learn more about this plugin, visit https://github.com/groovy/GMavenPlus/wiki -->
313                 <groupId>org.codehaus.gmavenplus</groupId>
314                 <artifactId>gmavenplus-plugin</artifactId>
315                 <version>1.9.0</version>
316                 <executions>
317                     <execution>
318                         <goals>
319                             <goal>compileTests</goal>
320                         </goals>
321                     </execution>
322                 </executions>
323             </plugin>
324             <!-- Required because names of spec classes don't match default
325                 Surefire patterns (`*Test` etc.) -->
326             <plugin>
327                 <groupId>org.apache.maven.plugins</groupId>
328                 <artifactId>maven-surefire-plugin</artifactId>
329                 <configuration>
330                     <!--suppress UnresolvedMavenProperty -->
331                     <argLine>${surefireArgLine}</argLine>
332                     <useFile>false</useFile>
333                     <includes>
334                         <include>**/*Spec.java</include>
335                         <include>**/*Test.java</include> <!-- Just in case of having also "normal" JUnit tests -->
336                     </includes>
337                     <excludes>
338                         <exclude>**/IT*.java</exclude>
339                     </excludes>
340                     <environmentVariables>
341                         <!--
342                             disable privileged container usage to cleanup the test containers;
343                             these will be removed automatically on jvm termination;
344                             see https://www.testcontainers.org/features/configuration/#disabling-ryuk
345                          -->
346                         <TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
347                     </environmentVariables>
348                 </configuration>
349             </plugin>
350             <plugin>
351                 <groupId>org.jacoco</groupId>
352                 <artifactId>jacoco-maven-plugin</artifactId>
353                 <executions>
354                     <execution>
355                         <id>default-prepare-agent</id>
356                         <goals>
357                             <goal>prepare-agent</goal>
358                         </goals>
359                     </execution>
360                     <execution>
361                         <id>coverage-check</id>
362                         <goals>
363                             <goal>check</goal>
364                         </goals>
365                         <configuration>
366                             <excludes>
367                                 <exclude>org/onap/cps/rest/model/*</exclude>
368                             </excludes>
369                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
370                             <rules>
371                                 <rule>
372                                     <element>BUNDLE</element>
373                                     <limits>
374                                         <limit>
375                                             <counter>INSTRUCTION</counter>
376                                             <value>COVEREDRATIO</value>
377                                             <minimum>${minimum-coverage}</minimum>
378                                         </limit>
379                                     </limits>
380                                 </rule>
381                             </rules>
382                         </configuration>
383                     </execution>
384                     <execution>
385                         <id>report</id>
386                         <goals>
387                             <goal>report-aggregate</goal>
388                         </goals>
389                         <phase>verify</phase>
390                         <configuration>
391                             <dataFileIncludes>
392                                 <fileInclude>**/code-coverage/jacoco-ut.exec</fileInclude>
393                             </dataFileIncludes>
394                         </configuration>
395                     </execution>
396                 </executions>
397             </plugin>
398             <plugin>
399                 <groupId>com.github.spotbugs</groupId>
400                 <artifactId>spotbugs-maven-plugin</artifactId>
401             </plugin>
402             <plugin>
403                 <groupId>org.sonarsource.scanner.maven</groupId>
404                 <artifactId>sonar-maven-plugin</artifactId>
405             </plugin>
406         </plugins>
407     </build>
408 </project>