Unify DMaaP Data Router image creation
[dmaap/datarouter.git] / datarouter-node / pom.xml
1 <!--
2   ============LICENSE_START==================================================
3   * org.onap.dmaap
4   * ===========================================================================
5   * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6   * Modifications Copyright (C) 2018 Nokia. All rights reserved.
7   * ===========================================================================
8   * Licensed under the Apache License, Version 2.0 (the "License");
9   * you may not use this file except in compliance with the License.
10   * You may obtain a copy of the License at
11   *
12    *      http://www.apache.org/licenses/LICENSE-2.0
13   *
14    * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License 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   * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22   *
23 -->
24 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
25     <modelVersion>4.0.0</modelVersion>
26     <parent>
27         <groupId>org.onap.dmaap.datarouter</groupId>
28         <artifactId>parent</artifactId>
29         <version>1.0.3-SNAPSHOT</version>
30         <relativePath>../pom.xml</relativePath>
31     </parent>
32     <artifactId>datarouter-node</artifactId>
33     <packaging>jar</packaging>
34     <name>datarouter-node</name>
35     <url>https://github.com/att/DMAAP_DATAROUTER</url>
36     <properties>
37         <sonar.skip>false</sonar.skip>
38         <sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>
39         <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath>
40         <docker.location>${basedir}/target/${artifactId}</docker.location>
41         <datarouter.node.image.name>onap/dmaap/datarouter-node</datarouter.node.image.name>
42     </properties>
43     <dependencies>
44         <dependency>
45             <groupId>com.google.guava</groupId>
46             <artifactId>guava</artifactId>
47             <version>${google.guava.version}</version>
48         </dependency>
49         <dependency>
50             <groupId>commons-codec</groupId>
51             <artifactId>commons-codec</artifactId>
52             <version>${commons-codec.version}</version>
53         </dependency>
54         <dependency>
55             <groupId>junit</groupId>
56             <artifactId>junit</artifactId>
57             <version>4.10</version>
58             <scope>test</scope>
59         </dependency>
60         <dependency>
61             <groupId>org.json</groupId>
62             <artifactId>json</artifactId>
63             <version>20160810</version>
64         </dependency>
65         <dependency>
66             <groupId>javax.mail</groupId>
67             <artifactId>javax.mail-api</artifactId>
68             <version>${javax.mail-api.version}</version>
69         </dependency>
70         <dependency>
71             <groupId>com.att.eelf</groupId>
72             <artifactId>eelf-core</artifactId>
73             <version>0.0.1</version>
74         </dependency>
75         <dependency>
76             <groupId>com.thoughtworks.xstream</groupId>
77             <artifactId>xstream</artifactId>
78             <version>${thoughtworks.version}</version>
79         </dependency>
80         <dependency>
81             <groupId>ch.qos.logback</groupId>
82             <artifactId>logback-classic</artifactId>
83             <version>${qos.logback.version}</version>
84             <scope>compile</scope>
85         </dependency>
86         <dependency>
87             <groupId>ch.qos.logback</groupId>
88             <artifactId>logback-core</artifactId>
89             <version>${qos.logback.version}</version>
90             <scope>compile</scope>
91         </dependency>
92         <dependency>
93             <groupId>org.eclipse.jetty</groupId>
94             <artifactId>jetty-server</artifactId>
95             <version>${jetty.version}</version>
96         </dependency>
97         <dependency>
98             <groupId>org.eclipse.jetty</groupId>
99             <artifactId>jetty-continuation</artifactId>
100             <version>${jetty.version}</version>
101         </dependency>
102         <dependency>
103             <groupId>org.eclipse.jetty</groupId>
104             <artifactId>jetty-util</artifactId>
105             <version>${jetty.version}</version>
106         </dependency>
107         <dependency>
108             <groupId>org.eclipse.jetty</groupId>
109             <artifactId>jetty-deploy</artifactId>
110             <version>${jetty.version}</version>
111         </dependency>
112         <dependency>
113             <groupId>org.eclipse.jetty</groupId>
114             <artifactId>jetty-servlet</artifactId>
115             <version>${jetty.version}</version>
116         </dependency>
117         <dependency>
118             <groupId>org.eclipse.jetty</groupId>
119             <artifactId>jetty-servlets</artifactId>
120             <version>${jetty.version}</version>
121         </dependency>
122         <dependency>
123             <groupId>org.eclipse.jetty</groupId>
124             <artifactId>jetty-http</artifactId>
125             <version>${jetty.version}</version>
126         </dependency>
127         <dependency>
128             <groupId>org.eclipse.jetty</groupId>
129             <artifactId>jetty-security</artifactId>
130             <version>${jetty.version}</version>
131         </dependency>
132         <dependency>
133             <groupId>org.eclipse.jetty</groupId>
134             <artifactId>jetty-websocket</artifactId>
135             <version>${jetty.websocket.version}</version>
136         </dependency>
137         <dependency>
138             <groupId>org.eclipse.jetty</groupId>
139             <artifactId>jetty-io</artifactId>
140             <version>${jetty.version}</version>
141         </dependency>
142         <dependency>
143             <groupId>org.apache.commons</groupId>
144             <artifactId>commons-io</artifactId>
145             <version>1.3.2</version>
146         </dependency>
147         <dependency>
148             <groupId>commons-lang</groupId>
149             <artifactId>commons-lang</artifactId>
150             <version>2.4</version>
151         </dependency>
152         <dependency>
153             <groupId>commons-io</groupId>
154             <artifactId>commons-io</artifactId>
155             <version>2.1</version>
156             <scope>compile</scope>
157         </dependency>
158         <dependency>
159             <groupId>org.apache.httpcomponents</groupId>
160             <artifactId>httpcore</artifactId>
161             <version>4.4</version>
162         </dependency>
163         <dependency>
164             <groupId>org.mozilla</groupId>
165             <artifactId>rhino</artifactId>
166             <version>1.7R3</version>
167         </dependency>
168         <dependency>
169             <groupId>org.apache.james</groupId>
170             <artifactId>apache-mime4j-core</artifactId>
171             <version>0.7</version>
172         </dependency>
173         <dependency>
174             <groupId>org.apache.httpcomponents</groupId>
175             <artifactId>httpclient</artifactId>
176             <version>4.5.3</version>
177         </dependency>
178         <dependency>
179             <groupId>org.sonatype.http-testing-harness</groupId>
180             <artifactId>junit-runner</artifactId>
181             <version>0.11</version>
182             <exclusions>
183                 <exclusion>
184                     <groupId>org.databene</groupId>
185                     <artifactId>contiperf</artifactId>
186                 </exclusion>
187             </exclusions>
188         </dependency>
189         <dependency>
190             <groupId>log4j</groupId>
191             <artifactId>log4j</artifactId>
192             <version>1.2.17</version>
193             <scope>compile</scope>
194         </dependency>
195         <dependency>
196             <groupId>junit</groupId>
197             <artifactId>junit</artifactId>
198             <version>4.10</version>
199             <scope>test</scope>
200         </dependency>
201         <dependency>
202             <groupId>org.mockito</groupId>
203             <artifactId>mockito-core</artifactId>
204             <version>1.10.19</version>
205             <scope>test</scope>
206         </dependency>
207         <dependency>
208             <groupId>org.powermock</groupId>
209             <artifactId>powermock-module-junit4</artifactId>
210             <version>1.6.4</version>
211             <scope>test</scope>
212         </dependency>
213         <dependency>
214             <groupId>org.powermock</groupId>
215             <artifactId>powermock-api-mockito</artifactId>
216             <version>1.6.4</version>
217             <scope>test</scope>
218         </dependency>
219         <dependency>
220             <groupId>org.apache.commons</groupId>
221             <artifactId>commons-lang3</artifactId>
222             <version>3.0</version>
223         </dependency>
224     </dependencies>
225     <profiles>
226         <profile>
227             <id>docker</id>
228             <properties>
229                 <skipDockerBuild>false</skipDockerBuild>
230                 <skipDockerTag>false</skipDockerTag>
231                 <skipTests>true</skipTests>
232             </properties>
233             <build>
234                 <plugins>
235                     <plugin>
236                         <groupId>com.spotify</groupId>
237                         <artifactId>docker-maven-plugin</artifactId>
238                         <version>${docker.maven.plugin.version}</version>
239                         <configuration>
240                             <imageName>${onap.nexus.dockerregistry.daily}/${datarouter.node.image.name}</imageName>
241                             <baseImage>java:8</baseImage>
242                             <serverId>${onap.nexus.dockerregistry.daily}</serverId>
243                             <skipDockerBuild>false</skipDockerBuild>
244                             <imageTags>
245                                 <imageTag>${project.version}</imageTag>
246                                 <imageTag>latest</imageTag>
247                             </imageTags>
248                             <forceTags>true</forceTags>
249                             <entryPoint>["/startup.sh", "start"]</entryPoint>
250                             <resources>
251                                 <resource>
252                                     <targetPath>/opt</targetPath>
253                                     <directory>${project.build.directory}/opt</directory>
254                                 </resource>
255                                 <resource>
256                                     <targetPath>/</targetPath>
257                                     <directory>${docker.location}</directory>
258                                     <include>startup.sh</include>
259                                 </resource>
260                             </resources>
261                             <runs>
262                                 <run>chmod 0700 /startup.sh</run>
263                             </runs>
264                             <exposes>
265                                 <expose>8080</expose>
266                                 <expose>8443</expose>
267                             </exposes>
268                         </configuration>
269                     </plugin>
270                 </plugins>
271             </build>
272         </profile>
273     </profiles>
274
275     <build>
276         <finalName>datarouter-node</finalName>
277         <resources>
278             <resource>
279                 <directory>src/main/resources</directory>
280                 <filtering>true</filtering>
281                 <includes>
282                     <include>**/*.properties</include>
283                 </includes>
284             </resource>
285             <resource>
286                 <directory>src/main/resources</directory>
287                 <filtering>true</filtering>
288                 <includes>
289                     <include>**/EelfMessages.properties</include>
290                 </includes>
291             </resource>
292             <resource>
293                 <directory>src/main/resources</directory>
294                 <filtering>true</filtering>
295                 <includes>
296                     <include>**/log4j.properties</include>
297                 </includes>
298             </resource>
299         </resources>
300         <plugins>
301             <plugin>
302                 <groupId>org.apache.maven.plugins</groupId>
303                 <artifactId>maven-compiler-plugin</artifactId>
304                 <configuration>
305                     <source>1.8</source>
306                     <target>1.8</target>
307                 </configuration>
308                 <version>3.6.0</version>
309             </plugin>
310             <plugin>
311                 <artifactId>maven-assembly-plugin</artifactId>
312                 <version>2.4</version>
313                 <configuration>
314                     <descriptorRefs>
315                         <descriptorRef>jar-with-dependencies</descriptorRef>
316                     </descriptorRefs>
317                     <outputDirectory>${basedir}/target/opt/app/datartr/lib</outputDirectory>
318                     <archive>
319                         <manifest>
320                             <addClasspath>true</addClasspath>
321                             <mainClass>org.onap.dmaap.datarouter.node.NodeMain</mainClass>
322                         </manifest>
323                     </archive>
324                 </configuration>
325                 <executions>
326                     <execution>
327                         <id>make-assembly</id>
328                         <!-- this is used for inheritance merges -->
329                         <phase>package</phase>
330                         <!-- bind to the packaging phase -->
331                         <goals>
332                             <goal>single</goal>
333                         </goals>
334                     </execution>
335                 </executions>
336             </plugin>
337             <plugin>
338                 <groupId>org.apache.maven.plugins</groupId>
339                 <artifactId>maven-resources-plugin</artifactId>
340                 <version>2.7</version>
341                 <executions>
342                     <execution>
343                         <id>copy-docker-file</id>
344                         <phase>package</phase>
345                         <goals>
346                             <goal>copy-resources</goal>
347                         </goals>
348                         <configuration>
349                             <outputDirectory>${docker.location}</outputDirectory>
350                             <overwrite>true</overwrite>
351                             <resources>
352                                 <resource>
353                                     <directory>${basedir}/src/main/resources/docker</directory>
354                                     <filtering>true</filtering>
355                                     <includes>
356                                         <include>**/*</include>
357                                     </includes>
358                                 </resource>
359                             </resources>
360                         </configuration>
361                     </execution>
362                     <execution>
363                         <id>copy-resources</id>
364                         <phase>validate</phase>
365                         <goals>
366                             <goal>copy-resources</goal>
367                         </goals>
368                         <configuration>
369                             <outputDirectory>${basedir}/target/opt/app/datartr/etc</outputDirectory>
370                             <resources>
371                                 <resource>
372                                     <directory>${basedir}/src/main/resources</directory>
373                                     <includes>
374                                         <include>misc/**</include>
375                                         <include>**/**</include>
376                                     </includes>
377                                 </resource>
378                             </resources>
379                         </configuration>
380                     </execution>
381                     <execution>
382                         <id>copy-resources-1</id>
383                         <phase>validate</phase>
384                         <goals>
385                             <goal>copy-resources</goal>
386                         </goals>
387                         <configuration>
388                             <outputDirectory>${basedir}/target/opt/app/datartr/aaf_certs</outputDirectory>
389                             <resources>
390                                 <resource>
391                                     <directory>${basedir}/aaf_certs</directory>
392                                     <includes>
393                                         <include>misc/**</include>
394                                         <include>**/**</include>
395                                     </includes>
396                                 </resource>
397                             </resources>
398                         </configuration>
399                     </execution>
400                 </executions>
401             </plugin>
402             <plugin>
403                 <groupId>org.apache.maven.plugins</groupId>
404                 <artifactId>maven-dependency-plugin</artifactId>
405                 <version>2.10</version>
406                 <executions>
407                     <execution>
408                         <id>copy-dependencies</id>
409                         <phase>package</phase>
410                         <goals>
411                             <goal>copy-dependencies</goal>
412                         </goals>
413                         <configuration>
414                             <outputDirectory>${project.build.directory}/opt/app/datartr/lib</outputDirectory>
415                             <overWriteReleases>false</overWriteReleases>
416                             <overWriteSnapshots>false</overWriteSnapshots>
417                             <overWriteIfNewer>true</overWriteIfNewer>
418                         </configuration>
419                     </execution>
420                 </executions>
421             </plugin>
422             <plugin>
423                 <groupId>org.apache.maven.plugins</groupId>
424                 <artifactId>maven-javadoc-plugin</artifactId>
425                 <configuration>
426                     <failOnError>false</failOnError>
427                 </configuration>
428                 <executions>
429                     <execution>
430                         <id>attach-javadocs</id>
431                         <goals>
432                             <goal>jar</goal>
433                         </goals>
434                     </execution>
435                 </executions>
436             </plugin>
437             <plugin>
438                 <groupId>org.apache.maven.plugins</groupId>
439                 <artifactId>maven-source-plugin</artifactId>
440                 <version>2.2.1</version>
441                 <executions>
442                     <execution>
443                         <id>attach-sources</id>
444                         <goals>
445                             <goal>jar-no-fork</goal>
446                         </goals>
447                     </execution>
448                 </executions>
449             </plugin>
450             <plugin>
451                 <groupId>org.codehaus.mojo</groupId>
452                 <artifactId>cobertura-maven-plugin</artifactId>
453                 <version>2.7</version>
454                 <configuration>
455                     <formats>
456                         <format>html</format>
457                         <format>xml</format>
458                     </formats>
459                     <check/>
460                 </configuration>
461             </plugin>
462             <plugin>
463                 <groupId>org.sonatype.plugins</groupId>
464                 <artifactId>nexus-staging-maven-plugin</artifactId>
465                 <version>1.6.7</version>
466                 <extensions>true</extensions>
467                 <configuration>
468                     <nexusUrl>${onap.nexus.url}</nexusUrl>
469                     <stagingProfileId>176c31dfe190a</stagingProfileId>
470                     <serverId>ecomp-staging</serverId>
471                 </configuration>
472             </plugin>
473             <plugin>
474                 <groupId>org.jacoco</groupId>
475                 <artifactId>jacoco-maven-plugin</artifactId>
476                 <version>${jacoco.version}</version>
477                 <configuration>
478                     <excludes>
479                         <exclude>**/gen/**</exclude>
480                         <exclude>**/generated-sources/**</exclude>
481                         <exclude>**/yang-gen/**</exclude>
482                         <exclude>**/pax/**</exclude>
483                     </excludes>
484                 </configuration>
485                 <executions>
486                     <execution>
487                         <id>pre-unit-test</id>
488                         <goals>
489                             <goal>prepare-agent</goal>
490                         </goals>
491                         <configuration>
492                             <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
493                             <propertyName>surefireArgLine</propertyName>
494                         </configuration>
495                     </execution>
496                     <execution>
497                         <id>post-unit-test</id>
498                         <phase>test</phase>
499                         <goals>
500                             <goal>report</goal>
501                         </goals>
502                         <configuration>
503                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
504                             <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
505                         </configuration>
506                     </execution>
507                     <execution>
508                         <id>pre-integration-test</id>
509                         <phase>pre-integration-test</phase>
510                         <goals>
511                             <goal>prepare-agent</goal>
512                         </goals>
513                         <configuration>
514                             <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
515                             <propertyName>failsafeArgLine</propertyName>
516                         </configuration>
517                     </execution>
518                     <execution>
519                         <id>post-integration-test</id>
520                         <phase>post-integration-test</phase>
521                         <goals>
522                             <goal>report</goal>
523                         </goals>
524                         <configuration>
525                             <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
526                             <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
527                         </configuration>
528                     </execution>
529                 </executions>
530             </plugin>
531         </plugins>
532     </build>
533 </project>