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