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