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