Merge "[BUG] Correctly parse observedTimestamp"
[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.35</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         <spring-boot-maven-plugin.version>2.3.3.RELEASE</spring-boot-maven-plugin.version>
30         <swagger-codegen-maven-plugin.version>3.0.18</swagger-codegen-maven-plugin.version>
31         <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
32         <tag.version>${project.version}</tag.version>
33     </properties>
34
35     <distributionManagement>
36         <repository>
37             <id>ecomp-releases</id>
38             <name>ECOMP Release Repository</name>
39             <url>${nexusproxy}${releaseNexusPath}</url>
40         </repository>
41         <snapshotRepository>
42             <id>ecomp-snapshots</id>
43             <name>ECOMP Snapshot Repository</name>
44             <url>${nexusproxy}${snapshotNexusPath}</url>
45         </snapshotRepository>
46     </distributionManagement>
47
48     <profiles>
49         <profile>
50             <id>docker</id>
51             <activation>
52                 <activeByDefault>false</activeByDefault>
53             </activation>
54             <build>
55                 <pluginManagement>
56                     <plugins>
57                         <plugin>
58                             <groupId>com.google.cloud.tools</groupId>
59                             <artifactId>jib-maven-plugin</artifactId>
60                             <version>${jib-maven-plugin.version}</version>
61                             <configuration>
62                                 <container>
63                                     <mainClass>${app}</mainClass>
64                                     <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
65                                 </container>
66                                 <from>
67                                     <image>${base.image}</image>
68                                 </from>
69                                 <to>
70                                     <image>${repository.name}</image>
71                                     <tags>
72                                         <tag>${tag.version}</tag>
73                                     </tags>
74                                 </to>
75                             </configuration>
76                             <executions>
77                                 <execution>
78                                     <phase>package</phase>
79                                     <id>build</id>
80                                     <goals>
81                                         <goal>dockerBuild</goal>
82                                     </goals>
83                                 </execution>
84                                 <execution>
85                                     <phase>deploy</phase>
86                                     <id>buildAndPush</id>
87                                     <goals>
88                                         <goal>build</goal>
89                                     </goals>
90                                 </execution>
91                             </executions>
92                         </plugin>
93                     </plugins>
94                 </pluginManagement>
95             </build>
96         </profile>
97     </profiles>
98
99     <dependencyManagement>
100         <dependencies>
101             <dependency>
102                 <groupId>org.onap.cps</groupId>
103                 <artifactId>cps-dependencies</artifactId>
104                 <version>${project.version}</version>
105                 <type>pom</type>
106                 <scope>import</scope>
107             </dependency>
108             <dependency>
109                 <groupId>org.onap.cps</groupId>
110                 <artifactId>cps-bom</artifactId>
111                 <version>${project.version}</version>
112                 <type>pom</type>
113                 <scope>import</scope>
114             </dependency>
115         </dependencies>
116     </dependencyManagement>
117
118     <build>
119         <resources>
120             <resource>
121                 <directory>src/main/resources</directory>
122                 <filtering>true</filtering>
123             </resource>
124             <resource>
125                 <directory>target/generated-sources/license</directory>
126                 <includes>
127                     <include>third-party-licenses.txt</include>
128                 </includes>
129             </resource>
130             <resource>
131                 <directory>target/generated-resources/licenses</directory>
132                 <includes>
133                     <include>*.*</include>
134                 </includes>
135                 <targetPath>third-party-licenses</targetPath>
136             </resource>
137         </resources>
138         <pluginManagement>
139             <plugins>
140                 <plugin>
141                     <groupId>org.springframework.boot</groupId>
142                     <artifactId>spring-boot-maven-plugin</artifactId>
143                     <version>${spring-boot-maven-plugin.version}</version>
144                     <executions>
145                         <execution>
146                             <goals>
147                                 <goal>build-info</goal>
148                                 <goal>repackage</goal>
149                             </goals>
150                         </execution>
151                     </executions>
152                 </plugin>
153                 <!-- Swagger code generation. -->
154                 <plugin>
155                     <groupId>io.swagger.codegen.v3</groupId>
156                     <artifactId>swagger-codegen-maven-plugin</artifactId>
157                     <version>${swagger-codegen-maven-plugin.version}</version>
158                     <executions>
159                         <execution>
160                             <goals>
161                                 <goal>generate</goal>
162                             </goals>
163                             <configuration>
164                                 <inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec>
165                                 <invokerPackage>org.onap.cps.rest.controller</invokerPackage>
166                                 <modelPackage>org.onap.cps.rest.model</modelPackage>
167                                 <apiPackage>org.onap.cps.rest.api</apiPackage>
168                                 <language>spring</language>
169                                 <generateSupportingFiles>false</generateSupportingFiles>
170                                 <configOptions>
171                                     <sourceFolder>src/gen/java</sourceFolder>
172                                     <dateLibrary>java11</dateLibrary>
173                                     <interfaceOnly>true</interfaceOnly>
174                                     <useTags>true</useTags>
175                                 </configOptions>
176                             </configuration>
177                         </execution>
178                     </executions>
179                 </plugin>
180                 <plugin>
181                     <groupId>com.google.cloud.tools</groupId>
182                     <artifactId>jib-maven-plugin</artifactId>
183                     <version>${jib-maven-plugin.version}</version>
184                     <configuration>
185                         <container>
186                             <mainClass>${app}</mainClass>
187                             <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
188                         </container>
189                         <from>
190                             <image>${base.image}</image>
191                         </from>
192                         <to>
193                             <image>${repository.name}</image>
194                             <tags>
195                                 <tag>${tag.version}</tag>
196                             </tags>
197                         </to>
198                     </configuration>
199                 </plugin>
200             </plugins>
201         </pluginManagement>
202         <plugins>
203             <plugin>
204                 <groupId>org.apache.maven.plugins</groupId>
205                 <artifactId>maven-compiler-plugin</artifactId>
206                 <configuration>
207                     <source>${java.version}</source>
208                     <target>${java.version}</target>
209                 </configuration>
210             </plugin>
211             <plugin>
212                 <groupId>org.apache.maven.plugins</groupId>
213                 <artifactId>maven-checkstyle-plugin</artifactId>
214                 <executions>
215                     <execution>
216                         <id>onap-license</id>
217                         <goals>
218                             <goal>check</goal>
219                         </goals>
220                         <phase>process-sources</phase>
221                         <configuration>
222                             <configLocation>onap-checkstyle/check-license.xml</configLocation>
223                             <includeResources>false</includeResources>
224                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
225                             <includeTestResources>false</includeTestResources>
226                             <sourceDirectories>
227                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
228                             </sourceDirectories>
229                             <consoleOutput>false</consoleOutput>
230                             <violationSeverity>warning</violationSeverity>
231                             <failOnViolation>true</failOnViolation>
232                         </configuration>
233                     </execution>
234                     <execution>
235                         <id>onap-java-style</id>
236                         <goals>
237                             <goal>check</goal>
238                         </goals>
239                         <phase>process-sources</phase>
240                         <configuration>
241                             <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
242                             <sourceDirectories>
243                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
244                             </sourceDirectories>
245                             <includeResources>true</includeResources>
246                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
247                             <includeTestResources>true</includeTestResources>
248                             <consoleOutput>false</consoleOutput>
249                             <violationSeverity>warning</violationSeverity>
250                             <failOnViolation>true</failOnViolation>
251                         </configuration>
252                     </execution>
253                     <execution>
254                         <id>cps-java-style</id>
255                         <goals>
256                             <goal>check</goal>
257                         </goals>
258                         <phase>process-sources</phase>
259                         <configuration>
260                             <configLocation>cps-java-style.xml</configLocation>
261                             <sourceDirectories>
262                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
263                             </sourceDirectories>
264                             <includeResources>true</includeResources>
265                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
266                             <includeTestResources>true</includeTestResources>
267                             <consoleOutput>true</consoleOutput>
268                             <violationSeverity>warning</violationSeverity>
269                             <failOnViolation>true</failOnViolation>
270                         </configuration>
271                     </execution>
272                 </executions>
273                 <dependencies>
274                     <dependency>
275                         <groupId>org.onap.oparent</groupId>
276                         <artifactId>checkstyle</artifactId>
277                         <version>${oparent.version}</version>
278                     </dependency>
279                     <dependency>
280                         <groupId>${project.groupId}</groupId>
281                         <artifactId>checkstyle</artifactId>
282                         <version>${project.version}</version>
283                     </dependency>
284                 </dependencies>
285             </plugin>
286             <!-- Mandatory plugins for using Spock -->
287             <plugin>
288                 <!-- The gmavenplus plugin is used to compile Groovy code.
289                     To learn more about this plugin, visit https://github.com/groovy/GMavenPlus/wiki -->
290                 <groupId>org.codehaus.gmavenplus</groupId>
291                 <artifactId>gmavenplus-plugin</artifactId>
292                 <version>1.9.0</version>
293                 <executions>
294                     <execution>
295                         <goals>
296                             <goal>compileTests</goal>
297                         </goals>
298                     </execution>
299                 </executions>
300             </plugin>
301             <!-- Required because names of spec classes don't match default
302                 Surefire patterns (`*Test` etc.) -->
303             <plugin>
304                 <groupId>org.apache.maven.plugins</groupId>
305                 <artifactId>maven-surefire-plugin</artifactId>
306                 <configuration>
307                     <!--suppress UnresolvedMavenProperty -->
308                     <argLine>${surefireArgLine}</argLine>
309                     <useFile>false</useFile>
310                     <includes>
311                         <include>**/*Spec.java</include>
312                         <include>**/*Test.java</include> <!-- Just in case of having also "normal" JUnit tests -->
313                     </includes>
314                     <excludes>
315                         <exclude>**/IT*.java</exclude>
316                     </excludes>
317                     <environmentVariables>
318                         <!--
319                             disable privileged container usage to cleanup the test containers;
320                             these will be removed automatically on jvm termination;
321                             see https://www.testcontainers.org/features/configuration/#disabling-ryuk
322                          -->
323                         <TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
324                     </environmentVariables>
325                 </configuration>
326             </plugin>
327             <plugin>
328                 <groupId>org.jacoco</groupId>
329                 <artifactId>jacoco-maven-plugin</artifactId>
330                 <executions>
331                     <execution>
332                         <id>default-prepare-agent</id>
333                         <goals>
334                             <goal>prepare-agent</goal>
335                         </goals>
336                     </execution>
337                     <execution>
338                         <id>coverage-check</id>
339                         <goals>
340                             <goal>check</goal>
341                         </goals>
342                         <configuration>
343                             <excludes>
344                                 <exclude>org/onap/cps/rest/model/*</exclude>
345                             </excludes>
346                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
347                             <rules>
348                                 <rule>
349                                     <element>BUNDLE</element>
350                                     <limits>
351                                         <limit>
352                                             <counter>INSTRUCTION</counter>
353                                             <value>COVEREDRATIO</value>
354                                             <minimum>${minimum-coverage}</minimum>
355                                         </limit>
356                                     </limits>
357                                 </rule>
358                             </rules>
359                         </configuration>
360                     </execution>
361                 </executions>
362             </plugin>
363         </plugins>
364     </build>
365 </project>