CI: Migrate Sonar Scan job to GHA
[portal/nonrtric-controlpanel.git] / nonrtric-gateway / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 * ========================LICENSE_START=================================
4 * O-RAN-SC
5 * %%
6 * Copyright (C) 2021-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 xmlns="http://maven.apache.org/POM/4.0.0"
22     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
23     <modelVersion>4.0.0</modelVersion>
24     <parent>
25         <groupId>org.springframework.boot</groupId>
26         <artifactId>spring-boot-starter-parent</artifactId>
27         <version>3.0.6</version>
28         <relativePath />
29     </parent>
30     <groupId>org.o-ran-sc.nonrtric</groupId>
31     <artifactId>nonrtric-gateway</artifactId>
32     <version>1.3.0-SNAPSHOT</version>
33     <name>Nonrtric Gateway</name>
34     <description>Nonrtric Gateway</description>
35
36     <properties>
37         <java.version>17</java.version>
38         <spring-cloud.version>2022.0.2</spring-cloud.version>
39         <formatter-maven-plugin.version>2.13.0</formatter-maven-plugin.version>
40         <spotless-maven-plugin.version>2.30.0</spotless-maven-plugin.version>
41         <docker-maven-plugin.version>0.30.0</docker-maven-plugin.version>
42     </properties>
43
44     <dependencies>
45         <dependency>
46             <groupId>org.springframework.cloud</groupId>
47             <artifactId>spring-cloud-starter-gateway</artifactId>
48         </dependency>
49
50         <dependency>
51             <groupId>org.springframework.boot</groupId>
52             <artifactId>spring-boot-starter-test</artifactId>
53             <scope>test</scope>
54         </dependency>
55         <dependency>
56             <groupId>org.springframework.boot</groupId>
57             <artifactId>spring-boot-starter-actuator</artifactId>
58             <scope>runtime</scope>
59         </dependency>
60     </dependencies>
61
62     <dependencyManagement>
63         <dependencies>
64             <dependency>
65                 <groupId>org.springframework.cloud</groupId>
66                 <artifactId>spring-cloud-dependencies</artifactId>
67                 <version>${spring-cloud.version}</version>
68                 <type>pom</type>
69                 <scope>import</scope>
70             </dependency>
71         </dependencies>
72     </dependencyManagement>
73
74     <build>
75         <plugins>
76             <plugin>
77                 <groupId>org.springframework.boot</groupId>
78                 <artifactId>spring-boot-maven-plugin</artifactId>
79             </plugin>
80             <plugin>
81                 <groupId>net.revelc.code.formatter</groupId>
82                 <artifactId>formatter-maven-plugin</artifactId>
83                 <version>${formatter-maven-plugin.version}</version>
84                 <configuration>
85                     <lineEnding>LF</lineEnding>
86                     <configFile>${project.basedir}/eclipse-formatter.xml</configFile>
87                 </configuration>
88                 <!-- Use mvn formatter:format or spotless:apply -->
89             </plugin>
90             <plugin>
91                 <groupId>com.diffplug.spotless</groupId>
92                 <artifactId>spotless-maven-plugin</artifactId>
93                 <version>${spotless-maven-plugin.version}</version>
94                 <configuration>
95                     <lineEndings>UNIX</lineEndings>
96                     <java>
97                         <removeUnusedImports />
98                         <importOrder>
99                             <order>com,java,javax,org</order>
100                         </importOrder>
101                     </java>
102                 </configuration>
103                 <!-- Use mvn spotless:apply to rewrite source files use mvn spotless:check to validate files -->
104             </plugin>
105         </plugins>
106     </build>
107     <profiles>
108         <profile>
109             <id>docker</id>
110             <build>
111                 <plugins>
112                     <plugin>
113                         <groupId>io.fabric8</groupId>
114                         <artifactId>docker-maven-plugin</artifactId>
115                         <version>${docker-maven-plugin.version}</version>
116                         <inherited>false</inherited>
117                         <executions>
118                             <execution>
119                                 <id>generate-nonrtric-gateway-image</id>
120                                 <phase>package</phase>
121                                 <goals>
122                                     <goal>build</goal>
123                                 </goals>
124                                 <configuration>
125                                     <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
126                                     <images>
127                                         <image>
128                                             <name>o-ran-sc/nonrtric-gateway:${project.version}</name>
129                                             <build>
130                                                 <cleanup>try</cleanup>
131                                                 <contextDir>${basedir}</contextDir>
132                                                 <dockerFile>Dockerfile</dockerFile>
133                                                 <filter>false</filter>
134                                                 <args>
135                                                     <JAR>${project.build.finalName}.jar</JAR>
136                                                 </args>
137                                                 <tags>
138                                                     <tag>${project.version}</tag>
139                                                 </tags>
140                                             </build>
141                                         </image>
142                                     </images>
143                                 </configuration>
144                             </execution>
145                             <execution>
146                                 <id>push-nonrtric-gateway-image</id>
147                                 <goals>
148                                     <goal>build</goal>
149                                     <goal>push</goal>
150                                 </goals>
151                                 <configuration>
152                                     <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
153                                     <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>
154                                     <images>
155                                         <image>
156                                             <name>o-ran-sc/nonrtric-gateway:${project.version}</name>
157                                             <build>
158                                                 <contextDir>${basedir}</contextDir>
159                                                 <dockerFile>Dockerfile</dockerFile>
160                                                 <filter>false</filter>
161                                                 <args>
162                                                     <JAR>${project.build.finalName}.jar</JAR>
163                                                 </args>
164                                                 <tags>
165                                                     <tag>${project.version}</tag>
166                                                     <tag>latest</tag>
167                                                 </tags>
168                                             </build>
169                                         </image>
170                                     </images>
171                                 </configuration>
172                             </execution>
173                         </executions>
174                     </plugin>
175                 </plugins>
176             </build>
177         </profile>
178     </profiles>
179 </project>