Minimized image by multistage build
[nonrtric/plt/a1policymanagementservice.git] / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 * ========================LICENSE_START=================================
4 * O-RAN-SC
5 * %%
6 * Copyright (C) 2019-2023 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 <project
22     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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
25     <modelVersion>4.0.0</modelVersion>
26     <parent>
27         <groupId>org.springframework.boot</groupId>
28         <artifactId>spring-boot-starter-parent</artifactId>
29         <version>3.0.4</version>
30         <relativePath />
31     </parent>
32     <groupId>org.o-ran-sc.nonrtric.plt</groupId>
33     <artifactId>a1policymanagementservice</artifactId>
34     <version>2.6.0-SNAPSHOT</version>
35     <licenses>
36         <license>
37             <name>The Apache Software License, Version 2.0</name>
38             <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
39         </license>
40     </licenses>
41     <repositories>
42         <repository>
43             <id>onap-releases</id>
44             <name>onap-releases</name>
45             <url>https://nexus.onap.org/content/repositories/releases/</url>
46         </repository>
47     </repositories>
48     <properties>
49         <java.version>17</java.version>
50         <json.version>20220924</json.version>
51         <maven-compiler-plugin.version>3.10.0</maven-compiler-plugin.version>
52         <formatter-maven-plugin.version>2.13.0</formatter-maven-plugin.version>
53         <spotless-maven-plugin.version>2.30.0</spotless-maven-plugin.version>
54         <docker-maven-plugin>0.30.0</docker-maven-plugin>
55         <javax.ws.rs-api.version>2.1.1</javax.ws.rs-api.version>
56         <sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
57         <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
58         <exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
59         <software.amazon.awssdk.version>2.19.17</software.amazon.awssdk.version>
60         <springdoc.version>2.0.2</springdoc.version>
61     </properties>
62     <dependencies>
63         <dependency>
64             <groupId>commons-io</groupId>
65             <artifactId>commons-io</artifactId>
66             <version>2.11.0</version>
67         </dependency>
68         <dependency>
69             <groupId>com.google.guava</groupId>
70             <artifactId>guava</artifactId>
71             <version>31.1-jre</version>
72         </dependency>
73         <dependency>
74             <groupId>org.springframework.boot</groupId>
75             <artifactId>spring-boot-starter-web</artifactId>
76         </dependency>
77         <dependency>
78             <groupId>org.springframework.boot</groupId>
79             <artifactId>spring-boot-starter-thymeleaf</artifactId>
80         </dependency>
81         <dependency>
82             <groupId>org.springframework.boot</groupId>
83             <artifactId>spring-boot-starter-webflux</artifactId>
84         </dependency>
85         <dependency>
86             <groupId>org.springframework.boot</groupId>
87             <artifactId>spring-boot-starter-aop</artifactId>
88         </dependency>
89         <dependency>
90             <groupId>org.springframework.boot</groupId>
91             <artifactId>spring-boot-devtools</artifactId>
92             <optional>true</optional>
93         </dependency>
94         <dependency>
95             <groupId>org.springframework.boot</groupId>
96             <artifactId>spring-boot-starter-validation</artifactId>
97         </dependency>
98         <dependency>
99             <groupId>org.springframework</groupId>
100             <artifactId>spring-webflux</artifactId>
101         </dependency>
102         <dependency>
103             <groupId>com.google.code.gson</groupId>
104             <artifactId>gson</artifactId>
105             <version>${gson.version}</version>
106         </dependency>
107         <dependency>
108             <groupId>org.json</groupId>
109             <artifactId>json</artifactId>
110             <version>${json.version}</version>
111         </dependency>
112         <dependency>
113             <groupId>org.springframework.boot</groupId>
114             <artifactId>spring-boot-configuration-processor</artifactId>
115             <optional>true</optional>
116         </dependency>
117         <dependency>
118             <groupId>org.projectlombok</groupId>
119             <artifactId>lombok</artifactId>
120             <scope>provided</scope>
121         </dependency>
122         <dependency>
123             <groupId>javax.ws.rs</groupId>
124             <artifactId>javax.ws.rs-api</artifactId>
125             <version>${javax.ws.rs-api.version}</version>
126         </dependency>
127         <dependency>
128             <groupId>org.glassfish.jersey.inject</groupId>
129             <artifactId>jersey-hk2</artifactId>
130         </dependency>
131         <!-- Actuator dependencies -->
132         <dependency>
133             <groupId>org.springframework.boot</groupId>
134             <artifactId>spring-boot-starter-actuator</artifactId>
135         </dependency>
136         <!--REQUIRED
137         TO GENERATE DOCUMENTATION -->
138         <dependency>
139             <groupId>org.springdoc</groupId>
140             <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
141             <version>${springdoc.version}</version>
142         </dependency>
143         <dependency>
144             <groupId>org.springdoc</groupId>
145             <artifactId>springdoc-openapi-ui</artifactId>
146             <version>${springdoc.version}</version>
147         </dependency>
148         <!-- TEST -->
149         <dependency>
150             <groupId>org.springdoc</groupId>
151             <artifactId>springdoc-openapi-ui</artifactId>
152             <version>1.6.14</version>
153             <scope>test</scope>
154         </dependency>
155         <dependency>
156             <groupId>org.springframework.boot</groupId>
157             <artifactId>spring-boot-starter-test</artifactId>
158             <scope>test</scope>
159         </dependency>
160         <dependency>
161             <groupId>org.awaitility</groupId>
162             <artifactId>awaitility</artifactId>
163             <scope>test</scope>
164         </dependency>
165         <dependency>
166             <groupId>io.projectreactor</groupId>
167             <artifactId>reactor-test</artifactId>
168             <scope>test</scope>
169         </dependency>
170         <dependency>
171             <groupId>org.junit.jupiter</groupId>
172             <artifactId>junit-jupiter-engine</artifactId>
173             <scope>test</scope>
174         </dependency>
175         <dependency>
176             <groupId>org.mockito</groupId>
177             <artifactId>mockito-junit-jupiter</artifactId>
178             <scope>test</scope>
179         </dependency>
180         <dependency>
181             <groupId>org.mockito</groupId>
182             <artifactId>mockito-core</artifactId>
183             <scope>test</scope>
184         </dependency>
185         <dependency>
186             <groupId>com.squareup.okhttp3</groupId>
187             <artifactId>mockwebserver</artifactId>
188             <scope>test</scope>
189         </dependency>
190         <!-- https://mvnrepository.com/artifact/com.github.erosb/everit-json-schema -->
191         <dependency>
192             <groupId>com.github.erosb</groupId>
193             <artifactId>everit-json-schema</artifactId>
194             <version>1.14.1</version>
195         </dependency>
196         <dependency>
197             <groupId>software.amazon.awssdk</groupId>
198             <artifactId>s3</artifactId>
199             <version>${software.amazon.awssdk.version}</version>
200         </dependency>
201         <dependency>
202             <groupId>io.micrometer</groupId>
203             <artifactId>micrometer-registry-prometheus</artifactId>
204         </dependency>
205     </dependencies>
206     <build>
207         <plugins>
208             <plugin>
209                 <groupId>org.springframework.boot</groupId>
210                 <artifactId>spring-boot-maven-plugin</artifactId>
211             </plugin>
212             <plugin>
213                 <groupId>org.apache.maven.plugins</groupId>
214                 <artifactId>maven-surefire-plugin</artifactId>
215                 <configuration>
216                     <skipTests>false</skipTests>
217                 </configuration>
218             </plugin>
219             <plugin>
220                 <artifactId>maven-failsafe-plugin</artifactId>
221             </plugin>
222             <plugin>
223                 <groupId>org.codehaus.mojo</groupId>
224                 <artifactId>build-helper-maven-plugin</artifactId>
225                 <executions>
226                     <execution>
227                         <id>add-source</id>
228                         <phase>generate-sources</phase>
229                         <goals>
230                             <goal>add-source</goal>
231                         </goals>
232                         <configuration>
233                             <sources>
234                                 <source>${project.build.directory}/generated-sources/annotations/</source>
235                             </sources>
236                         </configuration>
237                     </execution>
238                 </executions>
239             </plugin>
240             <plugin>
241                 <groupId>org.jacoco</groupId>
242                 <artifactId>jacoco-maven-plugin</artifactId>
243                 <version>${jacoco-maven-plugin.version}</version>
244                 <executions>
245                     <execution>
246                         <id>default-prepare-agent</id>
247                         <goals>
248                             <goal>prepare-agent</goal>
249                         </goals>
250                     </execution>
251                     <execution>
252                         <id>default-report</id>
253                         <phase>prepare-package</phase>
254                         <goals>
255                             <goal>report</goal>
256                         </goals>
257                     </execution>
258                 </executions>
259             </plugin>
260             <plugin>
261                 <groupId>io.fabric8</groupId>
262                 <artifactId>docker-maven-plugin</artifactId>
263                 <version>${docker-maven-plugin}</version>
264                 <inherited>false</inherited>
265                 <executions>
266                     <execution>
267                         <id>generate-a1policymanagementservice-image</id>
268                         <phase>package</phase>
269                         <goals>
270                             <goal>build</goal>
271                         </goals>
272                         <configuration>
273                             <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
274                             <images>
275                                 <image>
276                                     <name>
277                                         o-ran-sc/nonrtric-plt-a1policymanagementservice:${project.version}</name>
278                                     <build>
279                                         <cleanup>try</cleanup>
280                                         <contextDir>${basedir}</contextDir>
281                                         <dockerFile>Dockerfile</dockerFile>
282                                         <args>
283                                             <JAR>${project.build.finalName}.jar</JAR>
284                                         </args>
285                                         <tags>
286                                             <tag>${project.version}</tag>
287                                         </tags>
288                                     </build>
289                                 </image>
290                             </images>
291                         </configuration>
292                     </execution>
293                     <execution>
294                         <id>push-a1policymanagementservice-image</id>
295                         <goals>
296                             <goal>build</goal>
297                             <goal>push</goal>
298                         </goals>
299                         <configuration>
300                             <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
301                             <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>
302                             <images>
303                                 <image>
304                                     <name>
305                                         o-ran-sc/nonrtric-plt-a1policymanagementservice:${project.version}</name>
306                                     <build>
307                                         <contextDir>${basedir}</contextDir>
308                                         <dockerFile>Dockerfile</dockerFile>
309                                         <args>
310                                             <JAR>${project.build.finalName}.jar</JAR>
311                                         </args>
312                                         <tags>
313                                             <tag>${project.version}</tag>
314                                             <tag>latest</tag>
315                                         </tags>
316                                     </build>
317                                 </image>
318                             </images>
319                         </configuration>
320                     </execution>
321                 </executions>
322             </plugin>
323             <!-- support sonar in multi-module project -->
324             <plugin>
325                 <groupId>org.sonarsource.scanner.maven</groupId>
326                 <artifactId>sonar-maven-plugin</artifactId>
327                 <version>${sonar-maven-plugin.version}</version>
328             </plugin>
329             <plugin>
330                 <groupId>org.codehaus.mojo</groupId>
331                 <artifactId>exec-maven-plugin</artifactId>
332                 <version>${exec-maven-plugin.version}</version>
333                 <executions>
334                     <execution>
335                         <id>git submodule update</id>
336                         <phase>initialize</phase>
337                         <configuration>
338                             <executable>git</executable>
339                             <arguments>
340                                 <argument>submodule</argument>
341                                 <argument>update</argument>
342                                 <argument>--init</argument>
343                                 <argument>--recursive</argument>
344                             </arguments>
345                         </configuration>
346                         <goals>
347                             <goal>exec</goal>
348                         </goals>
349                     </execution>
350                     <execution>
351                         <id>copy configuration</id>
352                         <phase>initialize</phase>
353                         <configuration>
354                             <executable>cp</executable>
355                             <arguments>
356                                 <argument>-r</argument>
357                                 <argument>onap/oran/a1-policy-management/config</argument>
358                                 <argument>.</argument>
359                             </arguments>
360                         </configuration>
361                         <goals>
362                             <goal>exec</goal>
363                         </goals>
364                     </execution>
365                 </executions>
366             </plugin>
367         </plugins>
368     </build>
369     <issueManagement>
370         <system>JIRA</system>
371         <url>https://jira.o-ran-sc.org/</url>
372     </issueManagement>
373 </project>