Allow container to run as unprivileged user
[federation.git] / gateway / pom.xml
1 <?xml version="1.0"?>
2         <!--<![CDATA[
3         ===============LICENSE_START=======================================================
4         Acumos
5         ===================================================================================
6         Copyright (C) 2017 AT&T Intellectual Property & Tech Mahindra. All rights reserved.
7         ===================================================================================
8         This Acumos software file is distributed by AT&T and Tech Mahindra
9         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         This file 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
22         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
23         xmlns="http://maven.apache.org/POM/4.0.0"
24         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
25         <modelVersion>4.0.0</modelVersion>
26         <groupId>org.acumos.federation</groupId>
27         <artifactId>gateway</artifactId>
28         <version>2.0.1-SNAPSHOT</version>
29         <name>Federation Gateway</name>
30         <description>Federated Acumos Interface for inter-acumos and ONAP communication</description>
31
32         <parent>
33                 <groupId>org.springframework.boot</groupId>
34                 <artifactId>spring-boot-starter-parent</artifactId>
35                 <version>2.1.2.RELEASE</version>
36                 <!-- silence warning about parent relative path -->
37                 <relativePath />
38         </parent>
39
40         <properties>
41                 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
42                 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
43                 <!-- Stand-alone RESTFul application -->
44                 <start-class>org.acumos.federation.gateway.Application</start-class>
45                 <!-- Jenkins invokes mvn with argument -Dbuild.number=${BUILD_NUMBER} -->
46                 <build.number>0</build.number>
47                 <skipTests>false</skipTests>
48                 <!-- dependencies versions -->
49                 <logback.version>1.2.3</logback.version>
50                 <springfox.version>2.7.0</springfox.version>
51                 <!-- Not supplied to all jobs; e.g., Javadoc -->
52                 <docker.pull.registry>nexus3.acumos.org:10001</docker.pull.registry>
53                 <!-- Supplied by Jenkins -->
54                 <docker.push.registry>${env.NEXUS3_PUSH_REGISTRY}</docker.push.registry>
55         </properties>
56
57         <!-- Some dependencies are specific to Acumos, but this POM defines no repositories 
58                 section. The Jenkins server specifies Acumos repositories. Developers should 
59                 ensure their ~/.m2/settings.xml file has the following URLs in both the repositories 
60                 and pluginRepositories sections or in a profile: https://nexus.acumos.org/content/repositories/snapshots/ 
61                 https://nexus.acumos.org/content/repositories/releases/ -->
62
63         <dependencies>
64                 <dependency>
65                         <groupId>org.acumos.acumos-nexus-client</groupId>
66                         <artifactId>acumos-nexus-client</artifactId>
67                         <version>2.2.1</version>
68                 </dependency>
69                 <dependency>
70                         <groupId>org.acumos.common-dataservice</groupId>
71                         <artifactId>cmn-data-svc-client</artifactId>
72                         <version>2.0.7</version>
73                 </dependency>
74                 <dependency>
75                         <groupId>org.json</groupId>
76                         <artifactId>json</artifactId>
77                         <!-- Override Spring-boot choice -->
78                         <version>20160212</version><!--$NO-MVN-MAN-VER$ -->
79                 </dependency>
80                 <dependency>
81                         <groupId>org.slf4j</groupId>
82                         <artifactId>slf4j-api</artifactId>
83                         <!-- spring sets the <version>${slf4j.version}</version> -->
84                 </dependency>
85                 <dependency>
86                         <groupId>ch.qos.logback</groupId>
87                         <artifactId>logback-classic</artifactId>
88                         <!-- spring sets the <version>${logback.version}</version> -->
89                 </dependency>
90                 <dependency>
91                         <groupId>ch.qos.logback</groupId>
92                         <artifactId>logback-core</artifactId>
93                         <!-- spring sets the <version>${logback.version}</version> -->
94                 </dependency>
95                 <dependency>
96                         <groupId>org.springframework.boot</groupId>
97                         <artifactId>spring-boot-starter-security</artifactId>
98                         <!-- spring sets the ${spring.boot.starter.security.version}</version> -->
99                 </dependency>
100                 <dependency>
101                         <groupId>org.springframework.boot</groupId>
102                         <artifactId>spring-boot-starter-web</artifactId>
103                         <!-- spring sets the <version>${spring.boot.starter.web.version}</version> -->
104                 </dependency>
105                 <dependency>
106                         <groupId>org.springframework.boot</groupId>
107                         <artifactId>spring-boot-configuration-processor</artifactId>
108                         <!-- spring sets the <version>${spring.boot.configuration.processor.version}</version> -->
109                         <optional>true</optional>
110                 </dependency>
111                 <dependency>
112                         <groupId>com.google.guava</groupId>
113                         <artifactId>guava</artifactId>
114                         <version>19.0</version>
115                 </dependency>
116                 <dependency>
117                         <groupId>org.apache.httpcomponents</groupId>
118                         <artifactId>httpclient</artifactId>
119                         <!-- spring sets the <version>4.5</version> -->
120                 </dependency>
121                 <dependency>
122                         <groupId>org.springframework.shell</groupId>
123                         <artifactId>spring-shell</artifactId>
124                         <version>1.2.0.RELEASE</version>
125                 </dependency>
126                 <dependency>
127                         <groupId>io.springfox</groupId>
128                         <artifactId>springfox-swagger2</artifactId>
129                         <version>${springfox.version}</version>
130                 </dependency>
131                 <dependency>
132                         <groupId>io.springfox</groupId>
133                         <artifactId>springfox-swagger-ui</artifactId>
134                         <version>${springfox.version}</version>
135                 </dependency>
136                 <dependency>
137                         <groupId>javax.inject</groupId>
138                         <artifactId>javax.inject</artifactId>
139                         <version>1</version>
140                 </dependency>
141                 <dependency>
142                         <groupId>io.jsonwebtoken</groupId>
143                         <artifactId>jjwt</artifactId>
144                         <version>0.6.0</version>
145                 </dependency>
146                 <dependency>
147                         <groupId>org.python</groupId>
148                         <artifactId>jython-standalone</artifactId>
149                         <version>2.7.1-rc3</version>
150                 </dependency>
151                 <dependency>
152                         <groupId>com.fasterxml.jackson.core</groupId>
153                         <artifactId>jackson-core</artifactId>
154                         <!-- spring sets the <version>2.9.7</version> -->
155                 </dependency>
156                 <dependency>
157                         <groupId>com.fasterxml.jackson.datatype</groupId>
158                         <artifactId>jackson-datatype-jsr310</artifactId>
159                 </dependency>
160
161                 <dependency>
162                         <groupId>junit</groupId>
163                         <artifactId>junit</artifactId>
164                         <!-- spring sets the <version>3.8.1</version> -->
165                         <scope>test</scope>
166                 </dependency>
167                 <dependency>
168                         <groupId>commons-cli</groupId>
169                         <artifactId>commons-cli</artifactId>
170                         <version>1.2</version>
171                 </dependency>
172                 <dependency>
173                         <groupId>org.apache.commons</groupId>
174                         <artifactId>commons-lang3</artifactId>
175                         <!-- spring sets the <version>3.6</version> -->
176                 </dependency>
177                 <dependency>
178                         <groupId>org.apache.commons</groupId>
179                         <artifactId>commons-compress</artifactId>
180                         <version>1.5</version>
181                 </dependency>
182                 <!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
183                 <dependency>
184                         <groupId>commons-beanutils</groupId>
185                         <artifactId>commons-beanutils</artifactId>
186                         <version>1.9.3</version>
187                 </dependency>
188                 <dependency>
189                         <groupId>com.github.docker-java</groupId>
190                         <artifactId>docker-java</artifactId>
191                         <version>3.0.14</version>
192                 </dependency>
193                 <dependency>
194                         <groupId>org.aspectj</groupId>
195                         <artifactId>aspectjweaver</artifactId>
196                         <!-- spring sets the <version>1.8.13</version> -->
197                 </dependency>
198                 <dependency>
199                         <groupId>org.assertj</groupId>
200                         <artifactId>assertj-core</artifactId>
201                         <!-- spring sets the <version>3.8.0</version> -->
202                         <scope>test</scope>
203                 </dependency>
204                 <dependency>
205                         <groupId>org.mockito</groupId>
206                         <artifactId>mockito-core</artifactId>
207                         <!-- spring sets the <version>2.21.0</version> -->
208                         <scope>test</scope>
209                 </dependency>
210                 <dependency>
211                         <groupId>org.springframework.boot</groupId>
212                         <artifactId>spring-boot-starter-test</artifactId>
213                         <!-- spring sets the <version>2.1.2.RELEASE</version> -->
214                         <exclusions>
215                                 <!-- silence warning about duplicate JSON class -->
216                                 <exclusion>
217                                         <groupId>com.vaadin.external.google</groupId>
218                                         <artifactId>android-json</artifactId>
219                                 </exclusion>
220                         </exclusions>
221                         <scope>test</scope>
222                 </dependency>
223         </dependencies>
224
225         <build>
226                 <plugins>
227                         <plugin>
228                                 <groupId>org.apache.maven.plugins</groupId>
229                                 <artifactId>maven-compiler-plugin</artifactId>
230                                 <!-- spring sets the <version>3.0</version> -->
231                                 <configuration>
232                                         <source>1.8</source>
233                                         <target>1.8</target>
234                                 </configuration>
235                         </plugin>
236                         <!-- Add the build number to the jar manifest. Spring-Boot uses a complex 
237                                 packaging process that makes access to the original Manifest.MF very difficult. 
238                                 However, Java provides access to the implementation version for a package, 
239                                 so cram the build number into there. -->
240                         <plugin>
241                                 <groupId>org.apache.maven.plugins</groupId>
242                                 <artifactId>maven-jar-plugin</artifactId>
243                                 <configuration>
244                                         <archive>
245                                                 <manifest>
246                                                         <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
247                                                 </manifest>
248                                                 <manifestEntries>
249                                                         <Implementation-Version>${project.version}-b${build.number}</Implementation-Version>
250                                                 </manifestEntries>
251                                         </archive>
252                                 </configuration>
253                                 <executions>
254                                         <execution>
255                                                 <goals>
256                                                         <goal>test-jar</goal>
257                                                 </goals>
258                                         </execution>
259                                 </executions>
260                         </plugin>
261                         <plugin>
262                                 <groupId>org.springframework.boot</groupId>
263                                 <artifactId>spring-boot-maven-plugin</artifactId>
264                                 <executions>
265                                         <execution>
266                                                 <goals>
267                                                         <goal>repackage</goal>
268                                                 </goals>
269                                         </execution>
270                                 </executions>
271                         </plugin>
272                         <plugin>
273                                 <groupId>org.apache.maven.plugins</groupId>
274                                 <artifactId>maven-dependency-plugin</artifactId>
275                                 <!-- spring sets the <version>2.10</version> -->
276                                 <executions>
277                                         <execution>
278                                                 <id>copy-dependencies</id>
279                                                 <phase>package</phase>
280                                                 <goals>
281                                                         <goal>copy-dependencies</goal>
282                                                 </goals>
283                                                 <configuration>
284                                                         <outputDirectory>${project.build.directory}/deps</outputDirectory>
285                                                         <overWriteReleases>true</overWriteReleases>
286                                                         <overWriteSnapshots>true</overWriteSnapshots>
287                                                         <overWriteIfNewer>true</overWriteIfNewer>
288                                                 </configuration>
289                                         </execution>
290                                 </executions>
291                         </plugin>
292                         <!-- No need to deploy Spring super-jar -->
293                         <plugin>
294                                 <groupId>org.apache.maven.plugins</groupId>
295                                 <artifactId>maven-deploy-plugin</artifactId>
296                                 <!-- Spring sets the <version>2.8</version> -->
297                                 <configuration>
298                                         <skip>true</skip>
299                                 </configuration>
300                         </plugin>
301                         <plugin>
302                                 <groupId>io.fabric8</groupId>
303                                 <artifactId>docker-maven-plugin</artifactId>
304                                 <version>0.23.0</version>
305                                 <configuration>
306                                         <verbose>true</verbose>
307                                         <dockerHost>${docker.host.url}</dockerHost>
308                                         <registry>${docker.registry.url}</registry>
309                                         <authConfig>
310                                                 <username>${docker.registry.login}</username>
311                                                 <password>${docker.registry.password}</password>
312                                         </authConfig>
313                                         <images>
314                                                 <image>
315                                                         <!-- Specify a tag to avoid default tag "latest" -->
316                                                         <name>federation-gateway:${project.version}</name>
317                                                         <build>
318                                                                 <from>openjdk:8-jre-slim</from>
319                                                                 <tags>
320                                                                         <!-- Add tag with build number -->
321                                                                         <tag>${project.version}-b${build.number}</tag>
322                                                                 </tags>
323                                                                 <assembly>
324                                                                         <inline>
325                                                                                 <files>
326                                                                                         <file>
327                                                                                                 <source>target/${project.artifactId}-${project.version}.${project.packaging}</source>
328                                                                                                 <outputDirectory />
329                                                                                         </file>
330                                                                                 </files>
331                                                                         </inline>
332                                                                 </assembly>
333                                                                 <runCmds>
334                                                                         <!-- Ensure logs dir exists and is world writable -->
335                                                                         <runCmd>mkdir /maven/logs</runCmd>
336                                                                         <runCmd>chmod -R 777 /maven</runCmd>
337                                                                 </runCmds>
338                                                                 <!-- This is the same CMD used in a Dockerfile -->
339                                                                 <cmd>
340                                                                         <!-- CDATA prevents Eclipse formatter from breaking line -->
341                                                                         <shell><![CDATA[cd /maven; java -Xms256m -Xmx2g -Djava.security.egd=file:/dev/./urandom -jar ${project.artifactId}-${project.version}.${project.packaging}]]></shell>
342                                                                 </cmd>
343                                                         </build>
344                                                 </image>
345                                                 <image>
346                                                         <name>federation-gateway-test:${project.version}</name>
347                                                         <build>
348                                                                 <from>openjdk:8-jre-slim</from>
349                                                                 <tags>
350                                                                         <tag>${project.version}-b${build.number}</tag>
351                                                                 </tags>
352                                                                 <assembly>
353                                                                         <inline>
354                                                                                 <files>
355                                                                                         <file>
356                                                                                                 <source>target/${project.artifactId}-${project.version}.${project.packaging}.original</source>
357                                                                                                 <outputDirectory />
358                                                                                                 <!-- <destName>target/${project.artifactId}-${project.version}.${project.packaging}</destName> -->
359                                                                                         </file>
360                                                                                         <file>
361                                                                                                 <source>target/${project.artifactId}-${project.version}-tests.${project.packaging}</source>
362                                                                                                 <outputDirectory />
363                                                                                         </file>
364                                                                                 </files>
365                                                                                 <fileSets>
366                                                                                         <fileSet>
367                                                                                                 <!-- <directory>${project.build.directory}/deps/</directory> -->
368                                                                                                 <directory>target/deps/</directory>
369                                                                                                 <outputDirectory>/libs/</outputDirectory>
370                                                                                                 <includes>
371                                                                                                         <include>*</include>
372                                                                                                 </includes>
373                                                                                                 <fileMode>0755</fileMode>
374                                                                                         </fileSet>
375                                                                                 </fileSets>
376                                                                         </inline>
377                                                                 </assembly>
378                                                                 <runCmds>
379                                                                         <!-- Ensure logs dir exists and is world writable -->
380                                                                         <runCmd>mkdir /maven/logs</runCmd>
381                                                                         <runCmd>chmod -R 777 /maven</runCmd>
382                                                                 </runCmds>
383                                                                 <cmd>
384                                                                         <!-- CDATA prevents Eclipse formatter from breaking line -->
385                                                                         <shell><![CDATA[cd /maven; java -Xms256m -Xmx2g -cp ${project.artifactId}-${project.version}.${project.packaging}.original:${project.artifactId}-${project.version}-tests.${project.packaging}:/libs/* -Djava.security.egd=file:/dev/./urandom org.springframework.boot.loader.PropertiesLauncher]]></shell>
386                                                                 </cmd>
387                                                         </build>
388                                                 </image>
389                                         </images>
390                                 </configuration>
391                                 <executions>
392                                         <execution>
393                                                 <goals>
394                                                         <!-- build is bound to install phase -->
395                                                         <goal>build</goal>
396                                                         <!-- push is bound to deploy phase -->
397                                                         <goal>push</goal>
398                                                 </goals>
399                                         </execution>
400                                 </executions>
401                         </plugin>
402                         <!--
403                         <plugin>
404                                 <groupId>org.codehaus.mojo</groupId>
405                                 <artifactId>license-maven-plugin</artifactId>
406                                 <version>1.14</version>
407                                 <configuration>
408                                         <licenseName>acumos</licenseName>
409                                         <licenseResolver>${project.baseUri}/src/license</licenseResolver>
410                                         <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
411                                         <processStartTag>===============LICENSE_START=======================================================</processStartTag>
412                                         <processEndTag>===============LICENSE_END=========================================================</processEndTag>
413                                         <sectionDelimiter>===================================================================================</sectionDelimiter>
414                                         <inceptionYear>2017</inceptionYear>
415                                         <organizationName>AT&amp;T Intellectual Property &amp; Tech
416                                                 Mahindra. All rights reserved.</organizationName>
417                                         <projectName>Acumos</projectName>
418                                         <canUpdateCopyright>true</canUpdateCopyright>
419                                         <canUpdateDescription>true</canUpdateDescription>
420                                         <canUpdateLicense>true</canUpdateLicense>
421                                         <emptyLineAfterHeader>true</emptyLineAfterHeader>
422                                         <includes>
423                                                 <include>**/*.java</include>
424                                         </includes>
425                                 </configuration>
426                                 <executions>
427                                         <execution>
428                                                 <id>first</id>
429                                                 <goals>
430                                                         <goal>update-file-header</goal>
431                                                 </goals>
432                                                 <phase>process-sources</phase>
433                                         </execution>
434                                 </executions>
435                         </plugin>
436                         -->
437                         <plugin>
438                                 <groupId>org.jacoco</groupId>
439                                 <artifactId>jacoco-maven-plugin</artifactId>
440                                 <version>0.7.9</version>
441                                 <executions>
442                                         <execution>
443                                                 <id>default-prepare-agent</id>
444                                                 <goals>
445                                                         <goal>prepare-agent</goal>
446                                                 </goals>
447                                         </execution>
448                                         <execution>
449                                                 <id>default-report</id>
450                                                 <phase>prepare-package</phase>
451                                                 <goals>
452                                                         <goal>report</goal>
453                                                 </goals>
454                                         </execution>
455                                 </executions>
456                         </plugin>
457                 </plugins>
458         </build>
459 </project>