e7ca3ad8b8b4a28648c2fa0ccab3ce0f19d5ee3b
[portal/nonrtric-controlpanel.git] / webapp-backend / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3
4
5 <![CDATA[
6 ========================LICENSE_START=================================
7 O-RAN-SC
8 %%
9 Copyright (C) 2019 AT&T Intellectual Property
10 Modifications Copyright (C) 2020 Nordix Foundation
11 %%
12 Licensed under the Apache License, Version 2.0 (the "License");
13 you may not use this file except in compliance with the License.
14 You may obtain a copy of the License at
15
16      http://www.apache.org/licenses/LICENSE-2.0
17
18 Unless required by applicable law or agreed to in writing, software
19 distributed under the License is distributed on an "AS IS" BASIS,
20 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 See the License for the specific language governing permissions and
22 limitations under the License.
23 ========================LICENSE_END===================================
24 ]]>-->
25 <project
26     xmlns="http://maven.apache.org/POM/4.0.0"
27     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
28         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
29     <modelVersion>4.0.0</modelVersion>
30     <parent>
31         <groupId>org.o-ran-sc.portal.nonrtric.controlpanel</groupId>
32         <artifactId>nonrtric-controlpanel-parent</artifactId>
33         <version>1.0.0-SNAPSHOT</version>
34     </parent>
35     <artifactId>nonrtric-controlpanel-be</artifactId>
36     <name>Non-RT RIC Controlpanel Webapp backend</name>
37     <properties>
38         <epsdk-fw.version>2.6.0</epsdk-fw.version>
39         <springfox.version>2.9.2</springfox.version>
40         <immutable.version>2.7.1</immutable.version>
41         <apache-axis2.version>1.7.9</apache-axis2.version>
42         <formatter-maven-plugin.version>2.8.1</formatter-maven-plugin.version>
43         <spotless-maven-plugin.version>1.18.0</spotless-maven-plugin.version>
44         <jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
45         <docker-maven-plugin.version>0.33.0</docker-maven-plugin.version>
46         <!-- Set by Jenkins -->
47         <build.number>0</build.number>
48     </properties>
49     <repositories>
50         <repository>
51             <id>onap-releases</id>
52             <name>ONAP - Release Repository</name>
53             <url>https://nexus.onap.org/content/repositories/releases</url>
54         </repository>
55     </repositories>
56     <dependencies>
57         <!-- Platform components -->
58         <dependency>
59             <groupId>org.onap.portal.sdk</groupId>
60             <artifactId>epsdk-fw</artifactId>
61             <version>${epsdk-fw.version}</version>
62             <exclusions>
63                 <exclusion>
64                     <groupId>commons-logging</groupId>
65                     <artifactId>commons-logging</artifactId>
66                 </exclusion>
67                 <exclusion>
68                     <groupId>log4j</groupId>
69                     <artifactId>log4j</artifactId>
70                 </exclusion>
71                 <exclusion>
72                     <groupId>log4j</groupId>
73                     <artifactId>apache-log4j-extras</artifactId>
74                 </exclusion>
75                 <exclusion>
76                     <groupId>org.slf4j</groupId>
77                     <artifactId>slf4j-log4j12</artifactId>
78                 </exclusion>
79                 <exclusion>
80                     <groupId>junit</groupId>
81                     <artifactId>junit</artifactId>
82                 </exclusion>
83                 <exclusion>
84                     <groupId>commons-fileupload</groupId>
85                     <artifactId>commons-fileupload</artifactId>
86                 </exclusion>
87                 <exclusion>
88                     <groupId>commons-beanutils</groupId>
89                     <artifactId>commons-beanutils</artifactId>
90                 </exclusion>
91                 <!-- EELF omits "test" scope on this dependency -->
92                 <exclusion>
93                     <groupId>org.powermock</groupId>
94                     <artifactId>powermock-module-junit4</artifactId>
95                 </exclusion>
96                 <!-- EELF omits "test" scope on this dependency -->
97                 <exclusion>
98                     <groupId>org.powermock</groupId>
99                     <artifactId>powermock-api-mockito</artifactId>
100                 </exclusion>
101             </exclusions>
102         </dependency>
103         <dependency>
104             <groupId>org.springframework.boot</groupId>
105             <artifactId>spring-boot-starter-security</artifactId>
106         </dependency>
107         <dependency>
108             <groupId>org.springframework.boot</groupId>
109             <artifactId>spring-boot-starter-web</artifactId>
110         </dependency>
111         <dependency>
112             <groupId>org.slf4j</groupId>
113             <artifactId>slf4j-api</artifactId>
114         </dependency>
115         <dependency>
116             <groupId>org.apache.axis2</groupId>
117             <artifactId>axis2-kernel</artifactId>
118             <version>${apache-axis2.version}</version>
119         </dependency>
120         <!-- Bridge uses of Apache commons logging, like EPSDK-FW -->
121         <dependency>
122             <groupId>org.slf4j</groupId>
123             <artifactId>jcl-over-slf4j</artifactId>
124         </dependency>
125         <dependency>
126             <groupId>ch.qos.logback</groupId>
127             <artifactId>logback-classic</artifactId>
128         </dependency>
129         <dependency>
130             <groupId>ch.qos.logback</groupId>
131             <artifactId>logback-core</artifactId>
132         </dependency>
133         <dependency>
134             <groupId>io.springfox</groupId>
135             <artifactId>springfox-swagger2</artifactId>
136             <version>${springfox.version}</version>
137         </dependency>
138         <dependency>
139             <groupId>io.springfox</groupId>
140             <artifactId>springfox-swagger-ui</artifactId>
141             <version>${springfox.version}</version>
142         </dependency>
143         <dependency>
144             <groupId>org.immutables</groupId>
145             <artifactId>value</artifactId>
146             <version>${immutable.version}</version>
147             <scope>provided</scope>
148         </dependency>
149         <dependency>
150             <groupId>org.immutables</groupId>
151             <artifactId>gson</artifactId>
152             <version>${immutable.version}</version>
153         </dependency>
154         <!-- Test dependencies -->
155         <!-- Mockito supports development, not just testing -->
156         <dependency>
157             <groupId>org.mockito</groupId>
158             <artifactId>mockito-core</artifactId>
159             <scope>test</scope>
160         </dependency>
161         <dependency>
162             <groupId>org.springframework.boot</groupId>
163             <artifactId>spring-boot-starter-test</artifactId>
164             <scope>test</scope>
165         </dependency>
166         <dependency>
167             <groupId>org.junit.jupiter</groupId>
168             <artifactId>junit-jupiter-api</artifactId>
169             <scope>test</scope>
170         </dependency>
171         <dependency>
172             <groupId>org.junit.jupiter</groupId>
173             <artifactId>junit-jupiter-engine</artifactId>
174             <scope>test</scope>
175         </dependency>
176         <dependency>
177             <groupId>org.junit.platform</groupId>
178             <artifactId>junit-platform-launcher</artifactId>
179             <scope>test</scope>
180         </dependency>
181     </dependencies>
182     <build>
183         <plugins>
184             <plugin>
185                 <groupId>org.springframework.boot</groupId>
186                 <artifactId>spring-boot-maven-plugin</artifactId>
187             </plugin>
188             <plugin>
189                 <groupId>net.revelc.code.formatter</groupId>
190                 <artifactId>formatter-maven-plugin</artifactId>
191                 <version>${formatter-maven-plugin.version}</version>
192                 <configuration>
193                     <configFile>${project.basedir}/eclipse-formatter.xml</configFile>
194                 </configuration>
195                 <!-- https://code.revelc.net/formatter-maven-plugin/ use
196                     mvn formatter:format spotless:apply process-sources -->
197             </plugin>
198             <plugin>
199                 <groupId>com.diffplug.spotless</groupId>
200                 <artifactId>spotless-maven-plugin</artifactId>
201                 <version>${spotless-maven-plugin.version}</version>
202                 <configuration>
203                     <java>
204                         <removeUnusedImports />
205                         <importOrder>
206                             <order>com,java,javax,org</order>
207                         </importOrder>
208                     </java>
209                 </configuration>
210                 <!-- https://github.com/diffplug/spotless/tree/master/plugin-maven
211                     use mvn spotless:apply to rewrite source files use mvn spotless:check to
212                     validate source files -->
213             </plugin>
214             <plugin>
215                 <!-- Most configuration and all execution is inherited -->
216                 <groupId>org.codehaus.mojo</groupId>
217                 <artifactId>license-maven-plugin</artifactId>
218                 <configuration>
219                     <roots>
220                         <root>src</root>
221                     </roots>
222                     <excludes>
223                         <exclude>**/*.json</exclude>
224                     </excludes>
225                 </configuration>
226             </plugin>
227             <!-- Add the build number to the jar manifest. Spring-Boot uses a complex 
228                                 packaging process that makes access to the original Manifest.MF very difficult. 
229                                 However, Java provides access to the implementation version for a package, 
230                                 so cram the build number into there. -->
231             <plugin>
232                 <groupId>org.apache.maven.plugins</groupId>
233                 <artifactId>maven-jar-plugin</artifactId>
234                 <configuration>
235                     <archive>
236                         <manifest>
237                             <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
238                         </manifest>
239                         <manifestEntries>
240                             <Implementation-Version>${project.version}-b${build.number}</Implementation-Version>
241                         </manifestEntries>
242                     </archive>
243                 </configuration>
244             </plugin>
245             <plugin>
246                 <artifactId>maven-resources-plugin</artifactId>
247                 <executions>
248                     <execution>
249                         <id>copy-resources</id>
250                         <phase>validate</phase>
251                         <goals>
252                             <goal>copy-resources</goal>
253                         </goals>
254                         <configuration>
255                             <outputDirectory>${project.build.directory}/classes/resources/</outputDirectory>
256                             <resources>
257                                 <resource>
258                                     <directory>${project.parent.basedir}/webapp-frontend/dist/controlpanelApp/</directory>
259                                 </resource>
260                             </resources>
261                         </configuration>
262                     </execution>
263                 </executions>
264             </plugin>
265             <!-- do not deploy a jar or pom file -->
266             <plugin>
267                 <groupId>org.apache.maven.plugins</groupId>
268                 <artifactId>maven-deploy-plugin</artifactId>
269                 <configuration>
270                     <skip>true</skip>
271                 </configuration>
272             </plugin>
273             <plugin>
274                 <groupId>org.jacoco</groupId>
275                 <artifactId>jacoco-maven-plugin</artifactId>
276                 <version>${jacoco-maven-plugin.version}</version>
277                 <executions>
278                     <execution>
279                         <id>default-prepare-agent</id>
280                         <goals>
281                             <goal>prepare-agent</goal>
282                         </goals>
283                     </execution>
284                     <execution>
285                         <id>default-report</id>
286                         <phase>prepare-package</phase>
287                         <goals>
288                             <goal>report</goal>
289                         </goals>
290                     </execution>
291                 </executions>
292             </plugin>
293             <!-- https://stackoverflow.com/questions/39126226/fabric8-springboot-full-example -->
294             <plugin>
295                 <groupId>io.fabric8</groupId>
296                 <artifactId>docker-maven-plugin</artifactId>
297                 <version>${docker-maven-plugin.version}</version>
298                 <configuration>
299                     <verbose>true</verbose>
300                     <!-- environment variables supplied by Jenkins -->
301                     <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
302                     <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>
303                     <images>
304                         <image>
305                             <!-- Specify a tag to avoid default tag "latest" -->
306                             <!-- Avoid maven artifact name here -->
307                             <name>o-ran-sc/nonrtric-controlpanel:${project.version}</name>
308                             <build>
309                                 <from>openjdk:11-jre-slim</from>
310                                 <tags>
311                                     <!-- Add tag with build number -->
312                                     <tag>${project.version}</tag>
313                                 </tags>
314                                 <assembly>
315                                     <descriptorRef>artifact</descriptorRef>
316                                 </assembly>
317                                 <runCmds>
318                                     <!-- Ensure logs dir exists and is world writable -->
319                                     <runCmd>mkdir /logs</runCmd>
320                                     <runCmd>chmod -R 777 /logs</runCmd>
321                                 </runCmds>
322                                 <cmd>
323                                     <!-- Include maven dir on classpath for prop files -->
324                                     <exec>
325                                         <arg>java</arg>
326                                         <arg>-Xms128m</arg>
327                                         <arg>-Xmx256m</arg>
328                                         <arg>-cp</arg>
329                                         <arg>maven:maven/${project.artifactId}-${project.version}.${project.packaging}</arg>
330                                         <arg>-Dloader.main=org.oransc.portal.nonrtric.controlpanel.ControlpanelApplication</arg>
331                                         <arg>-Djava.security.egd=file:/dev/./urandom</arg>
332                                         <arg>org.springframework.boot.loader.PropertiesLauncher</arg>
333                                     </exec>
334                                 </cmd>
335                             </build>
336                         </image>
337                     </images>
338                 </configuration>
339                 <!-- build Docker images in install phase, push in deploy phase -->
340                 <executions>
341                     <execution>
342                         <goals>
343                             <goal>build</goal>
344                             <goal>push</goal>
345                         </goals>
346                     </execution>
347                 </executions>
348             </plugin>
349         </plugins>
350     </build>
351 </project>