Use env varialbes to replace image urls & tags
[nonrtric.git] / dmaap-adaptor-java / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 * ========================LICENSE_START=================================
4 * O-RAN-SC
5 * %%
6 * Copyright (C) 2021 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>2.5.3</version>
30         <relativePath />
31     </parent>
32     <groupId>org.o-ran-sc.nonrtric</groupId>
33     <artifactId>dmaap-adaptor</artifactId>
34     <version>1.0.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>11</java.version>
50         <springfox.version>3.0.0</springfox.version>
51         <immutable.version>2.8.2</immutable.version>
52         <sdk.version>1.1.6</sdk.version>
53         <swagger.version>2.1.6</swagger.version>
54         <json.version>20190722</json.version>
55         <commons-net.version>3.6</commons-net.version>
56         <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
57         <formatter-maven-plugin.version>2.12.2</formatter-maven-plugin.version>
58         <spotless-maven-plugin.version>1.24.3</spotless-maven-plugin.version>
59         <swagger-codegen-maven-plugin.version>3.0.11</swagger-codegen-maven-plugin.version>
60         <docker-maven-plugin>0.30.0</docker-maven-plugin>
61         <version.dmaap>1.1.11</version.dmaap>
62         <javax.ws.rs-api.version>2.1.1</javax.ws.rs-api.version>
63         <sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
64         <jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
65         <exec.skip>true</exec.skip>
66     </properties>
67     <dependencies>
68         <dependency>
69             <groupId>org.springdoc</groupId>
70             <artifactId>springdoc-openapi-ui</artifactId>
71             <version>1.5.4</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</groupId>
87             <artifactId>spring-webflux</artifactId>
88         </dependency>
89         <dependency>
90             <groupId>io.swagger.core.v3</groupId>
91             <artifactId>swagger-jaxrs2</artifactId>
92             <version>${swagger.version}</version>
93         </dependency>
94         <dependency>
95             <groupId>io.swagger.core.v3</groupId>
96             <artifactId>swagger-jaxrs2-servlet-initializer</artifactId>
97             <version>${swagger.version}</version>
98         </dependency>
99         <dependency>
100             <groupId>javax.xml.bind</groupId>
101             <artifactId>jaxb-api</artifactId>
102         </dependency>
103         <dependency>
104             <groupId>org.immutables</groupId>
105             <artifactId>value</artifactId>
106             <version>${immutable.version}</version>
107             <scope>provided</scope>
108         </dependency>
109         <dependency>
110             <groupId>org.immutables</groupId>
111             <artifactId>gson</artifactId>
112             <version>${immutable.version}</version>
113         </dependency>
114         <dependency>
115             <groupId>org.json</groupId>
116             <artifactId>json</artifactId>
117             <version>${json.version}</version>
118         </dependency>
119         <dependency>
120             <groupId>commons-net</groupId>
121             <artifactId>commons-net</artifactId>
122             <version>${commons-net.version}</version>
123         </dependency>
124         <dependency>
125             <groupId>org.onap.dcaegen2.services.sdk.rest.services</groupId>
126             <artifactId>cbs-client</artifactId>
127             <version>${sdk.version}</version>
128         </dependency>
129         <dependency>
130             <groupId>org.projectlombok</groupId>
131             <artifactId>lombok</artifactId>
132             <scope>provided</scope>
133         </dependency>
134         <dependency>
135             <groupId>javax.ws.rs</groupId>
136             <artifactId>javax.ws.rs-api</artifactId>
137             <version>${javax.ws.rs-api.version}</version>
138         </dependency>
139         <!-- https://mvnrepository.com/artifact/com.github.erosb/everit-json-schema -->
140         <dependency>
141             <groupId>com.github.erosb</groupId>
142             <artifactId>everit-json-schema</artifactId>
143             <version>1.12.1</version>
144         </dependency>
145         <!-- Actuator dependencies -->
146         <dependency>
147             <groupId>org.springframework.boot</groupId>
148             <artifactId>spring-boot-starter-actuator</artifactId>
149         </dependency>
150         <!--REQUIRED TO GENERATE DOCUMENTATION -->
151         <dependency>
152             <groupId>io.springfox</groupId>
153             <artifactId>springfox-swagger2</artifactId>
154             <version>${springfox.version}</version>
155         </dependency>
156         <dependency>
157             <groupId>io.springfox</groupId>
158             <artifactId>springfox-swagger-ui</artifactId>
159             <version>${springfox.version}</version>
160         </dependency>
161         <!-- For development help -->
162         <dependency>
163             <groupId>org.springframework.boot</groupId>
164             <artifactId>spring-boot-devtools</artifactId>
165             <optional>true</optional>
166         </dependency>
167         <dependency>
168             <groupId>org.springframework.boot</groupId>
169             <artifactId>spring-boot-configuration-processor</artifactId>
170             <optional>true</optional>
171         </dependency>
172         <!-- TEST -->
173         <dependency>
174             <groupId>org.springframework.boot</groupId>
175             <artifactId>spring-boot-starter-test</artifactId>
176             <scope>test</scope>
177         </dependency>
178         <dependency>
179             <groupId>org.awaitility</groupId>
180             <artifactId>awaitility</artifactId>
181             <scope>test</scope>
182         </dependency>
183         <dependency>
184             <groupId>io.projectreactor</groupId>
185             <artifactId>reactor-test</artifactId>
186             <scope>test</scope>
187         </dependency>
188         <dependency>
189             <groupId>org.junit.jupiter</groupId>
190             <artifactId>junit-jupiter-engine</artifactId>
191             <scope>test</scope>
192         </dependency>
193         <dependency>
194             <groupId>org.mockito</groupId>
195             <artifactId>mockito-junit-jupiter</artifactId>
196             <scope>test</scope>
197         </dependency>
198         <dependency>
199             <groupId>org.mockito</groupId>
200             <artifactId>mockito-core</artifactId>
201             <scope>test</scope>
202         </dependency>
203         <dependency>
204             <groupId>com.squareup.okhttp3</groupId>
205             <artifactId>mockwebserver</artifactId>
206             <scope>test</scope>
207         </dependency>
208         <dependency>
209             <groupId>io.projectreactor.kafka</groupId>
210             <artifactId>reactor-kafka</artifactId>
211             <version>1.3.7</version>
212         </dependency>
213         <dependency>
214             <groupId>com.google.guava</groupId>
215             <artifactId>guava</artifactId>
216             <version>31.0.1-jre</version>
217         </dependency>
218     </dependencies>
219     <build>
220         <plugins>
221             <plugin>
222                 <groupId>org.springframework.boot</groupId>
223                 <artifactId>spring-boot-maven-plugin</artifactId>
224             </plugin>
225             <plugin>
226                 <groupId>net.revelc.code.formatter</groupId>
227                 <artifactId>formatter-maven-plugin</artifactId>
228                 <version>${formatter-maven-plugin.version}</version>
229                 <configuration>
230                     <configFile>${project.basedir}/eclipse-formatter.xml</configFile>
231                 </configuration>
232                 <!-- https://code.revelc.net/formatter-maven-plugin/ use mvn formatter:format
233                                         spotless:apply process-sources -->
234             </plugin>
235             <plugin>
236                 <groupId>com.diffplug.spotless</groupId>
237                 <artifactId>spotless-maven-plugin</artifactId>
238                 <version>${spotless-maven-plugin.version}</version>
239                 <configuration>
240                     <java>
241                         <removeUnusedImports />
242                         <importOrder>
243                             <order>com,java,javax,org</order>
244                         </importOrder>
245                     </java>
246                 </configuration>
247                 <!-- https://github.com/diffplug/spotless/tree/master/plugin-maven use
248                                         mvn spotless:apply to rewrite source files use mvn spotless:check to validate
249                                         source files -->
250             </plugin>
251             <plugin>
252                 <groupId>org.apache.maven.plugins</groupId>
253                 <artifactId>maven-surefire-plugin</artifactId>
254                 <configuration>
255                     <skipTests>false</skipTests>
256                 </configuration>
257             </plugin>
258             <plugin>
259                 <artifactId>maven-failsafe-plugin</artifactId>
260             </plugin>
261             <plugin>
262                 <groupId>org.codehaus.mojo</groupId>
263                 <artifactId>build-helper-maven-plugin</artifactId>
264                 <executions>
265                     <execution>
266                         <id>add-source</id>
267                         <phase>generate-sources</phase>
268                         <goals>
269                             <goal>add-source</goal>
270                         </goals>
271                         <configuration>
272                             <sources>
273                                 <source>${project.build.directory}/generated-sources/annotations/</source>
274                             </sources>
275                         </configuration>
276                     </execution>
277                 </executions>
278             </plugin>
279             <plugin>
280                 <groupId>org.jacoco</groupId>
281                 <artifactId>jacoco-maven-plugin</artifactId>
282                 <version>${jacoco-maven-plugin.version}</version>
283                 <executions>
284                     <execution>
285                         <id>default-prepare-agent</id>
286                         <goals>
287                             <goal>prepare-agent</goal>
288                         </goals>
289                     </execution>
290                     <execution>
291                         <id>default-report</id>
292                         <phase>prepare-package</phase>
293                         <goals>
294                             <goal>report</goal>
295                         </goals>
296                     </execution>
297                 </executions>
298             </plugin>
299             <plugin>
300                 <groupId>io.swagger.codegen.v3</groupId>
301                 <artifactId>swagger-codegen-maven-plugin</artifactId>
302                 <version>${swagger-codegen-maven-plugin.version}</version>
303                 <executions>
304                     <execution>
305                         <phase>test</phase>
306                         <goals>
307                             <goal>generate</goal>
308                         </goals>
309                         <configuration>
310                             <inputSpec>${project.basedir}/api/api.json</inputSpec>
311                             <language>openapi-yaml</language>
312                             <output>${project.basedir}/api</output>
313                             <configOptions>
314                                 <outputFile>api.yaml</outputFile>
315                             </configOptions>
316                         </configuration>
317                     </execution>
318                 </executions>
319             </plugin>
320             <plugin>
321                 <groupId>io.fabric8</groupId>
322                 <artifactId>docker-maven-plugin</artifactId>
323                 <version>${docker-maven-plugin}</version>
324                 <inherited>false</inherited>
325                 <executions>
326                     <execution>
327                         <id>generate-dmaap-adaptor-image</id>
328                         <phase>package</phase>
329                         <goals>
330                             <goal>build</goal>
331                         </goals>
332                         <configuration>
333                             <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
334                             <images>
335                                 <image>
336                                     <name>o-ran-sc/nonrtric-dmaap-adaptor:${project.version}</name>
337                                     <build>
338                                         <cleanup>try</cleanup>
339                                         <contextDir>${basedir}</contextDir>
340                                         <dockerFile>Dockerfile</dockerFile>
341                                         <args>
342                                             <JAR>${project.build.finalName}.jar</JAR>
343                                         </args>
344                                         <tags>
345                                             <tag>${project.version}</tag>
346                                         </tags>
347                                     </build>
348                                 </image>
349                             </images>
350                         </configuration>
351                     </execution>
352                     <execution>
353                         <id>push-dmaap-adaptor-image</id>
354                         <goals>
355                             <goal>build</goal>
356                             <goal>push</goal>
357                         </goals>
358                         <configuration>
359                             <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
360                             <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>
361                             <images>
362                                 <image>
363                                     <name>o-ran-sc/nonrtric-dmaap-adaptor:${project.version}</name>
364                                     <build>
365                                         <contextDir>${basedir}</contextDir>
366                                         <dockerFile>Dockerfile</dockerFile>
367                                         <args>
368                                             <JAR>${project.build.finalName}.jar</JAR>
369                                         </args>
370                                         <tags>
371                                             <tag>${project.version}</tag>
372                                             <tag>latest</tag>
373                                         </tags>
374                                     </build>
375                                 </image>
376                             </images>
377                         </configuration>
378                     </execution>
379                 </executions>
380             </plugin>
381             <!-- support sonar in multi-module project -->
382             <plugin>
383                 <groupId>org.sonarsource.scanner.maven</groupId>
384                 <artifactId>sonar-maven-plugin</artifactId>
385                 <version>${sonar-maven-plugin.version}</version>
386             </plugin>
387         </plugins>
388     </build>
389     <issueManagement>
390         <system>JIRA</system>
391         <url>https://jira.o-ran-sc.org/</url>
392     </issueManagement>
393 </project>