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