VES-Mapper container running as root
[dcaegen2/services/mapper.git] / UniversalVesAdapter / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 * ============LICENSE_START=======================================================
4 * ONAP : DCAEGEN2
5 * ================================================================================
6 * Copyright 2018-2019 TechMahindra
7 * Copyright (C) 2020 Huawei Technologies Co., Ltd.
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
23 <project 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
28         <groupId>org.onap.dcaegen2.services.mapper.vesadapter</groupId>
29         <artifactId>UniversalVesAdapter</artifactId>
30         <version>1.3.0-SNAPSHOT</version>
31
32
33         <parent>
34                 <groupId>org.onap.dcaegen2.services.mapper</groupId>
35                 <artifactId>mapper</artifactId>
36                 <version>1.3.0-SNAPSHOT</version>
37         </parent>
38
39         <properties>
40
41                 <!-- PROJECT SETTINGS -->
42                 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
43                 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
44                 <java.version>11</java.version>
45                 <docker.image.name>onap/org.onap.dcaegen2.services.mapper.vesadapter.universalvesadaptor</docker.image.name>
46                 <docker.user.name>VESAdapter</docker.user.name>
47                 <docker.user.dir>/opt/app/VESAdapter</docker.user.dir>
48                 <!-- PLUGIN SETTINGS -->
49                 <dependency.locations.enabled>false</dependency.locations.enabled>
50
51                 <!-- NEXUS RELATED SETTINGS -->
52                 <nexusproxy>https://nexus.onap.org</nexusproxy>
53                 <snapshots.path>content/repositories/snapshots/</snapshots.path>
54                 <releases.path>content/repositories/releases/</releases.path>
55                 <site.path>
56                         content/sites/site/org/onap/dcaegen2/services/mapper/${project.artifactId}/${project.version}
57                 </site.path>
58                 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
59
60                 <!-- DCAE SDK version -->
61                 <sdk.version>1.8.7</sdk.version>
62
63         </properties>
64         <dependencies>
65                 <!-- Junit, Mockito, PowerMock -->
66                 <dependency>
67                         <groupId>junit</groupId>
68                         <artifactId>junit</artifactId>
69                         <version>4.12</version>
70                         <scope>test</scope>
71                 </dependency>
72                 <dependency>
73                         <groupId>org.mockito</groupId>
74                         <artifactId>mockito-core</artifactId>
75                         <version>2.0.5-beta</version>
76                         <scope>test</scope>
77                 </dependency>
78
79                 <dependency>
80                         <groupId>org.powermock</groupId>
81                         <artifactId>powermock-api-mockito</artifactId>
82                         <version>1.6.2</version>
83                         <scope>test</scope>
84                 </dependency>
85                 <dependency>
86                         <groupId>org.powermock</groupId>
87                         <artifactId>powermock-module-junit4</artifactId>
88                         <version>1.6.2</version>
89                         <scope>test</scope>
90                 </dependency>
91                 <dependency>
92                         <groupId>org.javassist</groupId>
93                         <artifactId>javassist</artifactId>
94                         <version>3.27.0-GA</version>
95                 </dependency>
96                 <dependency>
97                         <groupId>com.googlecode.json-simple</groupId>
98                         <artifactId>json-simple</artifactId>
99                         <version>1.1.1</version>
100                 </dependency>
101                 <dependency>
102                         <groupId>com.google.guava</groupId>
103                         <artifactId>guava</artifactId>
104                 </dependency>
105                 <dependency>
106                         <groupId>commons-configuration</groupId>
107                         <artifactId>commons-configuration</artifactId>
108                         <version>1.10</version>
109                 </dependency>
110                 <dependency>
111                         <groupId>com.google.code.gson</groupId>
112                         <artifactId>gson</artifactId>
113                         <version>2.8.5</version>
114                 </dependency>
115                 <dependency>
116                         <groupId>com.google.inject</groupId>
117                         <artifactId>guice</artifactId>
118                         <version>4.2.0</version>
119                 </dependency>
120                 <dependency>
121                         <groupId>org.apache.commons</groupId>
122                         <artifactId>commons-lang3</artifactId>
123                         <version>3.5</version>
124                 </dependency>
125                 <dependency>
126                         <groupId>com.google.inject.extensions</groupId>
127                         <artifactId>guice-assistedinject</artifactId>
128                         <version>4.2.0</version>
129                 </dependency>
130                 <dependency>
131                         <groupId>org.milyn</groupId>
132                         <artifactId>milyn-smooks-all</artifactId>
133                         <version>1.7.0</version>
134                         <exclusions>
135                                 <exclusion>
136                                         <groupId>javax.servlet</groupId>
137                                         <artifactId>servlet-api</artifactId>
138                                 </exclusion>
139                                 <exclusion>
140                                         <groupId>ognl</groupId>
141                                         <artifactId>ognl</artifactId>
142                                 </exclusion>
143                                 <exclusion>
144                                         <groupId>javax.jms</groupId>
145                                         <artifactId>jms</artifactId>
146                                 </exclusion>
147                         </exclusions>
148                 </dependency>
149                 <dependency>
150                         <groupId>ognl</groupId>
151                         <artifactId>ognl</artifactId>
152                         <version>3.1.12</version>
153                 </dependency>
154                 <dependency>
155                         <groupId>org.onap.dmaap.messagerouter.dmaapclient</groupId>
156                         <artifactId>dmaapClient</artifactId>
157                         <version>1.1.3</version>
158                         <exclusions>
159                                 <exclusion>
160                                         <groupId>javax.jms</groupId>
161                                         <artifactId>jms</artifactId>
162                                 </exclusion>
163                         </exclusions>
164                 </dependency>
165                 <!-- Database dependency -->
166                 <dependency>
167                         <groupId>org.postgresql</groupId>
168                         <artifactId>postgresql</artifactId>
169                         <version>42.2.18</version>
170                 </dependency>
171                 <dependency>
172                         <groupId>org.springframework</groupId>
173                         <artifactId>spring-jdbc</artifactId>
174                         <version>5.1.3.RELEASE</version>
175                 </dependency>
176                 <dependency>
177                         <groupId>org.springframework.boot</groupId>
178                         <artifactId>spring-boot-starter-web</artifactId>
179                         <version>2.1.1.RELEASE</version>
180                 </dependency>
181                 <dependency>
182                         <groupId>org.springframework.boot</groupId>
183                         <artifactId>spring-boot-starter-test</artifactId>
184                         <version>2.1.1.RELEASE</version>
185                         <scope>test</scope>
186                 </dependency>
187                 <dependency>
188                         <groupId>org.springframework.data</groupId>
189                         <artifactId>spring-data-commons</artifactId>
190                         <version>2.1.3.RELEASE</version>
191                 </dependency>
192                 <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
193                 <dependency>
194                         <groupId>org.slf4j</groupId>
195                         <artifactId>slf4j-api</artifactId>
196                         <version>1.7.25</version>
197                 </dependency>
198                 <dependency>
199                         <groupId>org.apache.logging.log4j</groupId>
200                         <artifactId>log4j-core</artifactId>
201                         <version>2.14.1</version>
202                 </dependency>
203                 <dependency>
204                         <groupId>org.codehaus.groovy</groupId>
205                         <artifactId>groovy-all</artifactId>
206                         <version>2.4.21</version>
207                 </dependency>
208                 <dependency>
209                         <groupId>com.jayway.jsonpath</groupId>
210                         <artifactId>json-path</artifactId>
211                         <version>2.4.0</version>
212                         <scope>test</scope>
213                 </dependency>
214                 <dependency>
215                         <groupId>com.fasterxml.jackson.core</groupId>
216                         <artifactId>jackson-core</artifactId>
217                         <version>2.11.2</version>
218                 </dependency>
219                 <dependency>
220                         <groupId>com.fasterxml.jackson.core</groupId>
221                         <artifactId>jackson-databind</artifactId>
222                         <version>2.11.2</version>
223                 </dependency>
224                 <dependency>
225                         <groupId>hsqldb</groupId>
226                         <artifactId>hsqldb</artifactId>
227                         <version>1.8.0.10</version>
228                         <scope>test</scope>
229                 </dependency>
230                 <!-- https://mvnrepository.com/artifact/xalan/xalan -->
231                 <dependency>
232                         <groupId>xalan</groupId>
233                         <artifactId>xalan</artifactId>
234                         <version>2.7.2</version>
235                 </dependency>
236                 <!-- https://mvnrepository.com/artifact/xerces/xercesImpl -->
237                 <dependency>
238                         <groupId>xerces</groupId>
239                         <artifactId>xercesImpl</artifactId>
240                         <version>2.12.1</version>
241                 </dependency>
242                 <!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
243                 <dependency>
244                         <groupId>com.thoughtworks.xstream</groupId>
245                         <artifactId>xstream</artifactId>
246                         <version>1.4.16</version>
247                 </dependency>
248                 <!-- https://mvnrepository.com/artifact/xml-apis/xml-apis -->
249                 <dependency>
250                         <groupId>xml-apis</groupId>
251                         <artifactId>xml-apis</artifactId>
252                         <version>1.4.01</version>
253                 </dependency>
254                 <!-- http client -->
255                 <dependency>
256                         <groupId>org.apache.httpcomponents</groupId>
257                         <artifactId>httpclient</artifactId>
258                         <version>${httpclient.version}</version>
259                         <scope>compile</scope>
260                 </dependency>
261                 <dependency>
262                         <groupId>org.apache.httpcomponents</groupId>
263                         <artifactId>httpmime</artifactId>
264                         <version>${httpclient.version}</version>
265                         <scope>compile</scope>
266                 </dependency>
267                 <dependency>
268                         <groupId>org.springframework.boot</groupId>
269                         <artifactId>spring-boot-configuration-processor</artifactId>
270                         <optional>true</optional>
271                         <version>2.1.1.RELEASE</version>
272                 </dependency>
273
274                 <!-- DCAE sdk dependency -->
275
276                 <dependency>
277                         <groupId>org.onap.dcaegen2.services.sdk.rest.services</groupId>
278                         <artifactId>cbs-client</artifactId>
279                         <version>${sdk.version}</version>
280                 </dependency>
281                 <!-- https://mvnrepository.com/artifact/io.projectreactor.netty/reactor-netty -->
282                 <dependency>
283                         <groupId>io.projectreactor.netty</groupId>
284                         <artifactId>reactor-netty</artifactId>
285                         <version>0.9.12.RELEASE</version>
286                 </dependency>
287         </dependencies>
288
289         <build>
290                 <pluginManagement>
291                         <plugins>
292                                 <plugin>
293                                         <artifactId>maven-assembly-plugin</artifactId>
294                                         <version>3.1.0</version>
295                                 </plugin>
296                                 <plugin>
297                                         <groupId>com.spotify</groupId>
298                                         <artifactId>docker-maven-plugin</artifactId>
299                                         <version>1.0.0</version>
300                                 </plugin>
301                         </plugins>
302                 </pluginManagement>
303                 <plugins>
304                         <plugin>
305                                 <artifactId>maven-assembly-plugin</artifactId>
306                                 <configuration>
307                                         <descriptors>
308                                                 <descriptor>src/assembly/dep.xml</descriptor>
309                                         </descriptors>
310                                         <attach>false</attach>
311                                         <appendAssemblyId>false</appendAssemblyId>
312                                         <updateOnly>true</updateOnly>
313                                 </configuration>
314                                 <executions>
315                                         <execution>
316                                                 <id>make-assembly</id>
317                                                 <phase>package</phase>
318                                                 <goals>
319                                                         <goal>single</goal>
320                                                 </goals>
321                                         </execution>
322                                 </executions>
323                         </plugin>
324                         <plugin>
325                                 <groupId>com.spotify</groupId>
326                                 <artifactId>docker-maven-plugin</artifactId>
327                                 <version>1.2.0</version>
328                                 <configuration>
329                                         <skipDockerBuild>false</skipDockerBuild>
330                                         <serverId>${onap.nexus.dockerregistry.daily}</serverId>
331                                         <imageName>${onap.nexus.dockerregistry.daily}/${docker.image.name}</imageName>
332                                         <imageTags>
333                                                 <imageTag>${project.version}-${maven.build.timestamp}Z</imageTag>
334                                                 <imageTag>${project.version}</imageTag>
335                                                 <imageTag>latest</imageTag>
336                                         </imageTags>
337                                         <baseImage>onap/integration-java11:9.0.0</baseImage>
338                                         <env>
339                                                 <HOSTALIASES>/etc/host.aliases</HOSTALIASES>
340                                         </env>
341                                         <workdir>${docker.user.dir}</workdir>
342                                         <resources>
343                                                 <resource>
344                                                         <targetPath>.</targetPath>
345                                                         <directory>${project.build.directory}/${project.artifactId}-${project.version}</directory>
346                                                 </resource>
347                                         </resources>
348                                         <runs>
349                                                 <run>useradd -r -U ${docker.user.name}</run>
350                                                 <run>chown -R ${docker.user.name}:${docker.user.name} ${docker.user.dir}</run>
351                                                 <run>chmod +x ${docker.user.dir}/bin/run.sh</run>
352                                                 <run>
353                                                         <![CDATA[apt-get update && apt-get install -y --no-install-recommends procps && apt-get install -y vim && apt-get install -y curl && apt-get clean all]]>
354                                                 </run>
355                                         </runs>
356                                         <cmd>${docker.user.dir}/bin/run.sh</cmd>
357                                         <exposes>
358                                                 <expose>8080</expose>
359                                                 <expose>8443</expose>
360                                         </exposes>
361                                         <user>${docker.user.name}</user>
362                                 </configuration>
363                                 <!--<executions> <execution> <id>build-image</id> <phase>package</phase> 
364                                         <goals> <goal>build</goal> </goals> </execution> <execution> <id>tag-and-push-image-latest</id> 
365                                         <phase>deploy</phase> <goals> <goal>tag</goal> </goals> <configuration> <image>${docker.image.name}:latest</image> 
366                                         <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:latest</newName> 
367                                         <pushImage>true</pushImage> </configuration> </execution> <execution> <id>tag-and-push-image-with-version</id> 
368                                         <phase>deploy</phase> <goals> <goal>tag</goal> </goals> <configuration> <image>${docker.image.name}:latest</image> 
369                                         <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version} 
370                                         </newName> <pushImage>true</pushImage> </configuration> </execution> <execution> 
371                                         <id>tag-and-push-image-with-version-and-date</id> <phase>deploy</phase> <goals> 
372                                         <goal>tag</goal> </goals> <configuration> <image>${docker.image.name}:latest</image> 
373                                         <newName> ${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}-${maven.build.timestamp}Z 
374                                         </newName> <pushImage>true</pushImage> </configuration> </execution> </executions> -->
375                         </plugin>
376                         <plugin>
377                                 <groupId>org.springframework.boot</groupId>
378                                 <artifactId>spring-boot-maven-plugin</artifactId>
379                                 <version>2.1.1.RELEASE</version>
380                                 <executions>
381                                         <execution>
382                                                 <goals>
383                                                         <goal>repackage</goal>
384                                                 </goals>
385                                                 <configuration>
386                                                         <mainClass>org.onap.universalvesadapter.Application</mainClass>
387                                                 </configuration>
388                                         </execution>
389                                 </executions>
390                         </plugin>
391                         <plugin>
392                                 <groupId>org.codehaus.mojo</groupId>
393                                 <artifactId>build-helper-maven-plugin</artifactId>
394                                 <version>1.9.1</version>
395                                 <executions>
396                                         <execution>
397                                                 <id>add-source</id>
398                                                 <phase>generate-sources</phase>
399                                                 <goals>
400                                                         <goal>add-source</goal>
401                                                 </goals>
402                                                 <configuration>
403                                                         <sources>
404                                                                 <source>src/gen/java</source>
405                                                         </sources>
406                                                 </configuration>
407                                         </execution>
408                                         <!-- <execution> <id>regex-property</id> <goals> <goal>regex-property</goal> 
409                                                 </goals> <configuration> <name>docker.version</name> <value>${project.version}</value> 
410                                                 <regex>(^[0-9]+.[0-9]+.[0-9]+$)</regex> <replacement>$1-STAGING</replacement> 
411                                                 <failIfNoMatch>false</failIfNoMatch> </configuration> </execution> -->
412                                 </executions>
413                         </plugin>
414                 </plugins>
415                 <!-- <finalName>UniversalVesAdapter</finalName> -->
416         </build>
417
418         <profiles>
419                 <profile>
420                         <id>with-system-proxy</id>
421                         <build>
422                                 <plugins>
423                                         <plugin>
424                                                 <groupId>com.spotify</groupId>
425                                                 <artifactId>docker-maven-plugin</artifactId>
426                                                 <configuration>
427                                                         <buildArgs>
428                                                                 <http_proxy>${env.http_proxy}</http_proxy>
429                                                         </buildArgs>
430                                                 </configuration>
431                                         </plugin>
432                                 </plugins>
433                         </build>
434                 </profile>
435         </profiles>
436
437
438         <repositories>
439                 <repository>
440                         <id>spring-releases</id>
441                         <url>https://repo.spring.io/libs-release</url>
442                 </repository>
443         </repositories>
444         <pluginRepositories>
445                 <pluginRepository>
446                         <id>spring-releases</id>
447                         <url>https://repo.spring.io/libs-release</url>
448                 </pluginRepository>
449         </pluginRepositories>
450 </project>