Install curl when building docker image
[portal/ric-dashboard.git] / webapp-backend / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--<![CDATA[
3 ========================LICENSE_START=================================
4 O-RAN-SC
5 %%
6 Copyright (C) 2019 AT&T Intellectual Property and Nokia
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"
23         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24         <modelVersion>4.0.0</modelVersion>
25         <parent>
26                 <groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
27                 <artifactId>ric-dash-parent</artifactId>
28                 <version>1.2.1-SNAPSHOT</version>
29         </parent>
30         <artifactId>ric-dash-be</artifactId>
31         <name>RIC Dashboard Webapp backend</name>
32         <properties>
33                 <springfox.version>2.9.2</springfox.version>
34                 <!-- Set by Jenkins -->
35                 <build.number>0</build.number>
36         </properties>
37         <repositories>
38                 <repository>
39                         <id>onap-releases</id>
40                         <name>ONAP - Release Repository</name>
41                         <url>https://nexus.onap.org/content/repositories/releases</url>
42                 </repository>
43         </repositories>
44         <dependencies>
45                 <!-- xApps -->
46                 <dependency>
47                         <groupId>org.o-ran-sc.ric.xapp.anr.client</groupId>
48                         <artifactId>anr-xapp-client</artifactId>
49                         <version>0.0.8-SNAPSHOT</version>
50                 </dependency>
51                 <!-- Platform components -->
52                 <dependency>
53                         <groupId>org.o-ran-sc.ric.plt.a1med.client</groupId>
54                         <artifactId>a1-med-client</artifactId>
55                         <version>0.10.3-SNAPSHOT</version>
56                 </dependency>
57                 <dependency>
58                         <groupId>org.o-ran-sc.ric.plt.appmgr.client</groupId>
59                         <artifactId>app-mgr-client</artifactId>
60                         <version>0.1.7-SNAPSHOT</version>
61                 </dependency>
62                 <dependency>
63                         <groupId>org.o-ran-sc.ric.plt.e2mgr.client</groupId>
64                         <artifactId>e2-mgr-client</artifactId>
65                         <version>2.0.5-SNAPSHOT</version>
66                 </dependency>
67                 <dependency>
68                         <groupId>org.onap.portal.sdk</groupId>
69                         <artifactId>epsdk-fw</artifactId>
70                         <version>2.4.0</version>
71                         <exclusions>
72                                 <exclusion>
73                                         <groupId>commons-logging</groupId>
74                                         <artifactId>commons-logging</artifactId>
75                                 </exclusion>
76                                 <exclusion>
77                                         <groupId>log4j</groupId>
78                                         <artifactId>log4j</artifactId>
79                                 </exclusion>
80                                 <exclusion>
81                                         <groupId>log4j</groupId>
82                                         <artifactId>apache-log4j-extras</artifactId>
83                                 </exclusion>
84                                 <exclusion>
85                                         <groupId>org.slf4j</groupId>
86                                         <artifactId>slf4j-log4j12</artifactId>
87                                 </exclusion>
88                                 <exclusion>
89                                         <groupId>junit</groupId>
90                                         <artifactId>junit</artifactId>
91                                 </exclusion>
92                                 <exclusion>
93                                         <groupId>commons-fileupload</groupId>
94                                         <artifactId>commons-fileupload</artifactId>
95                                 </exclusion>
96                                 <exclusion>
97                                         <groupId>commons-beanutils</groupId>
98                                         <artifactId>commons-beanutils</artifactId>
99                                 </exclusion>
100                                 <!-- EELF omits "test" scope on this dependency -->
101                                 <exclusion>
102                                         <groupId>org.powermock</groupId>
103                                         <artifactId>powermock-module-junit4</artifactId>
104                                 </exclusion>
105                                 <!-- EELF omits "test" scope on this dependency -->
106                                 <exclusion>
107                                         <groupId>org.powermock</groupId>
108                                         <artifactId>powermock-api-mockito</artifactId>
109                                 </exclusion>
110                         </exclusions>
111                 </dependency>
112                 <dependency>
113                         <groupId>org.springframework.boot</groupId>
114                         <artifactId>spring-boot-starter-security</artifactId>
115                 </dependency>
116                 <dependency>
117                         <groupId>org.springframework.boot</groupId>
118                         <artifactId>spring-boot-starter-web</artifactId>
119                 </dependency>
120                 <dependency>
121                         <groupId>org.slf4j</groupId>
122                         <artifactId>slf4j-api</artifactId>
123                 </dependency>
124                 <!-- Bridge uses of Apache commons logging, like EPSDK-FW -->
125                 <dependency>
126                         <groupId>org.slf4j</groupId>
127                         <artifactId>jcl-over-slf4j</artifactId>
128                 </dependency>
129                 <dependency>
130                         <groupId>ch.qos.logback</groupId>
131                         <artifactId>logback-classic</artifactId>
132                 </dependency>
133                 <dependency>
134                         <groupId>ch.qos.logback</groupId>
135                         <artifactId>logback-core</artifactId>
136                 </dependency>
137                 <dependency>
138                         <groupId>io.springfox</groupId>
139                         <artifactId>springfox-swagger2</artifactId>
140                         <version>${springfox.version}</version>
141                 </dependency>
142                 <dependency>
143                         <groupId>io.springfox</groupId>
144                         <artifactId>springfox-swagger-ui</artifactId>
145                         <version>${springfox.version}</version>
146                 </dependency>
147                 <!-- Test dependencies -->
148                 <!-- Mockito supports development, not just testing -->
149                 <dependency>
150                         <groupId>org.mockito</groupId>
151                         <artifactId>mockito-core</artifactId>
152                         <scope>test</scope>
153                 </dependency>
154                 <dependency>
155                         <groupId>org.springframework.boot</groupId>
156                         <artifactId>spring-boot-starter-test</artifactId>
157                         <scope>test</scope>
158                 </dependency>
159                 <dependency>
160                         <groupId>org.junit.jupiter</groupId>
161                         <artifactId>junit-jupiter-api</artifactId>
162                         <scope>test</scope>
163                 </dependency>
164                 <dependency>
165                         <groupId>org.junit.jupiter</groupId>
166                         <artifactId>junit-jupiter-engine</artifactId>
167                         <scope>test</scope>
168                 </dependency>
169                 <dependency>
170                         <groupId>org.junit.platform</groupId>
171                         <artifactId>junit-platform-launcher</artifactId>
172                         <!-- Override Spring-Boot choice for Eclipse -->
173                         <version>1.4.2</version>
174                         <scope>test</scope>
175                 </dependency>
176         </dependencies>
177         <build>
178                 <plugins>
179                         <plugin>
180                                 <groupId>org.springframework.boot</groupId>
181                                 <artifactId>spring-boot-maven-plugin</artifactId>
182                         </plugin>
183                         <plugin>
184                                 <groupId>org.codehaus.mojo</groupId>
185                                 <artifactId>license-maven-plugin</artifactId>
186                                 <executions>
187                                         <execution>
188                                                 <goals>
189                                                         <goal>update-file-header</goal>
190                                                 </goals>
191                                                 <phase>process-sources</phase>
192                                                 <configuration>
193                                                         <organizationName>${lmp.organization.name}</organizationName>
194                                                         <inceptionYear>${lmp.inception.year}</inceptionYear>
195                                                         <projectName>${lmp.project.name}</projectName>
196                                                         <licenseName>${lmp.license.name}</licenseName>
197                                                         <processStartTag>${lmp.process.start.tag}</processStartTag>
198                                                         <processEndTag>${lmp.process.end.tag}</processEndTag>
199                                                         <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
200                                                 </configuration>
201                                         </execution>
202                                 </executions>
203                         </plugin>
204                         <!-- Add the build number to the jar manifest. Spring-Boot uses a complex 
205                                 packaging process that makes access to the original Manifest.MF very difficult. 
206                                 However, Java provides access to the implementation version for a package, 
207                                 so cram the build number into there. -->
208                         <plugin>
209                                 <groupId>org.apache.maven.plugins</groupId>
210                                 <artifactId>maven-jar-plugin</artifactId>
211                                 <configuration>
212                                         <archive>
213                                                 <manifest>
214                                                         <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
215                                                 </manifest>
216                                                 <manifestEntries>
217                                                         <Implementation-Version>${project.version}-b${build.number}</Implementation-Version>
218                                                 </manifestEntries>
219                                         </archive>
220                                 </configuration>
221                         </plugin>
222                         <plugin>
223                                 <artifactId>maven-resources-plugin</artifactId>
224                                 <executions>
225                                         <execution>
226                                                 <id>copy-resources</id>
227                                                 <phase>validate</phase>
228                                                 <goals>
229                                                         <goal>copy-resources</goal>
230                                                 </goals>
231                                                 <configuration>
232                                                         <outputDirectory>${project.build.directory}/classes/resources/</outputDirectory>
233                                                         <resources>
234                                                                 <resource>
235                                                                         <directory>${project.parent.basedir}/webapp-frontend/dist/dashApp/</directory>
236                                                                 </resource>
237                                                         </resources>
238                                                 </configuration>
239                                         </execution>
240                                 </executions>
241                         </plugin>
242                         <!-- do not deploy a jar or pom file -->
243                         <plugin>
244                                 <groupId>org.apache.maven.plugins</groupId>
245                                 <artifactId>maven-deploy-plugin</artifactId>
246                                 <configuration>
247                                         <skip>true</skip>
248                                 </configuration>
249                         </plugin>
250                         <plugin>
251                                 <groupId>org.jacoco</groupId>
252                                 <artifactId>jacoco-maven-plugin</artifactId>
253                                 <version>0.8.4</version>
254                                 <executions>
255                                         <execution>
256                                                 <id>default-prepare-agent</id>
257                                                 <goals>
258                                                         <goal>prepare-agent</goal>
259                                                 </goals>
260                                         </execution>
261                                         <execution>
262                                                 <id>default-report</id>
263                                                 <phase>prepare-package</phase>
264                                                 <goals>
265                                                         <goal>report</goal>
266                                                 </goals>
267                                         </execution>
268                                 </executions>
269                         </plugin>
270                         <!-- https://stackoverflow.com/questions/39126226/fabric8-springboot-full-example -->
271                         <plugin>
272                                 <groupId>io.fabric8</groupId>
273                                 <artifactId>docker-maven-plugin</artifactId>
274                                 <version>0.30.0</version>
275                                 <configuration>
276                                         <verbose>true</verbose>
277                                         <!-- environment variables supplied by Jenkins -->
278                                         <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
279                                         <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>
280                                         <images>
281                                                 <image>
282                                                         <!-- Specify a tag to avoid default tag "latest" -->
283                                                         <!-- Avoid maven artifact name here -->
284                                                         <name>ric-dashboard:${project.version}</name>
285                                                         <build>
286                                                                 <from>openjdk:11-jre-slim</from>
287                                                                 <tags>
288                                                                         <!-- Add tag with build number -->
289                                                                         <tag>${project.version}</tag>
290                                                                 </tags>
291                                                                 <assembly>
292                                                                         <descriptorRef>artifact</descriptorRef>
293                                                                 </assembly>
294                                                                 <runCmds>
295                                                                         <!-- Include debug tool for limited network -->
296                                                                         <runCmd><![CDATA[apt-get update && apt-get -y install curl]]></runCmd>
297                                                                         <!-- Ensure logs dir exists and is world writable -->
298                                                                         <runCmd>mkdir /logs</runCmd>
299                                                                         <runCmd>chmod -R 777 /logs</runCmd>
300                                                                 </runCmds>
301                                                                 <cmd>
302                                                                         <!-- Include maven dir on classpath for prop files -->
303                                                                         <exec>
304                                                                                 <arg>java</arg>
305                                                                                 <arg>-Xms128m</arg>
306                                                                                 <arg>-Xmx256m</arg>
307                                                                                 <arg>-cp</arg>
308                                                                                 <arg>maven:maven/${project.artifactId}-${project.version}.${project.packaging}</arg>
309                                                                                 <arg>-Dloader.main=org.oransc.ric.portal.dashboard.DashboardApplication</arg>
310                                                                                 <arg>-Djava.security.egd=file:/dev/./urandom</arg>
311                                                                                 <arg>org.springframework.boot.loader.PropertiesLauncher</arg>
312                                                                         </exec>
313                                                                 </cmd>
314                                                         </build>
315                                                 </image>
316                                         </images>
317                                 </configuration>
318                                 <!-- build Docker images in install phase, push in deploy phase -->
319                                 <executions>
320                                         <execution>
321                                                 <goals>
322                                                         <goal>build</goal>
323                                                         <goal>push</goal>
324                                                 </goals>
325                                         </execution>
326                                 </executions>
327                         </plugin>
328                 </plugins>
329         </build>
330 </project>