small, multi-platform docker images
[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>2.0.2-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
42         <timestamp>${maven.build.timestamp}</timestamp>
43         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
44
45         <datarouter.node.image.name>onap/dmaap/datarouter-node</datarouter.node.image.name>
46     </properties>
47     <dependencies>
48         <dependency>
49             <groupId>com.google.guava</groupId>
50             <artifactId>guava</artifactId>
51             <version>${google.guava.version}</version>
52         </dependency>
53         <dependency>
54             <groupId>commons-codec</groupId>
55             <artifactId>commons-codec</artifactId>
56             <version>${commons-codec.version}</version>
57         </dependency>
58         <dependency>
59             <groupId>junit</groupId>
60             <artifactId>junit</artifactId>
61             <version>4.10</version>
62             <scope>test</scope>
63         </dependency>
64         <dependency>
65             <groupId>org.json</groupId>
66             <artifactId>json</artifactId>
67             <version>20160810</version>
68         </dependency>
69         <dependency>
70             <groupId>javax.mail</groupId>
71             <artifactId>javax.mail-api</artifactId>
72             <version>${javax.mail-api.version}</version>
73         </dependency>
74         <dependency>
75             <groupId>com.att.eelf</groupId>
76             <artifactId>eelf-core</artifactId>
77             <version>0.0.1</version>
78         </dependency>
79         <dependency>
80             <groupId>com.thoughtworks.xstream</groupId>
81             <artifactId>xstream</artifactId>
82             <version>${thoughtworks.version}</version>
83         </dependency>
84         <dependency>
85             <groupId>ch.qos.logback</groupId>
86             <artifactId>logback-classic</artifactId>
87             <version>${qos.logback.version}</version>
88             <scope>compile</scope>
89         </dependency>
90         <dependency>
91             <groupId>ch.qos.logback</groupId>
92             <artifactId>logback-core</artifactId>
93             <version>${qos.logback.version}</version>
94             <scope>compile</scope>
95         </dependency>
96         <dependency>
97             <groupId>org.eclipse.jetty</groupId>
98             <artifactId>jetty-server</artifactId>
99             <version>${jetty.version}</version>
100         </dependency>
101         <dependency>
102             <groupId>org.eclipse.jetty</groupId>
103             <artifactId>jetty-continuation</artifactId>
104             <version>${jetty.version}</version>
105         </dependency>
106         <dependency>
107             <groupId>org.eclipse.jetty</groupId>
108             <artifactId>jetty-util</artifactId>
109             <version>${jetty.version}</version>
110         </dependency>
111         <dependency>
112             <groupId>org.eclipse.jetty</groupId>
113             <artifactId>jetty-deploy</artifactId>
114             <version>${jetty.version}</version>
115         </dependency>
116         <dependency>
117             <groupId>org.eclipse.jetty</groupId>
118             <artifactId>jetty-servlet</artifactId>
119             <version>${jetty.version}</version>
120         </dependency>
121         <dependency>
122             <groupId>org.eclipse.jetty</groupId>
123             <artifactId>jetty-servlets</artifactId>
124             <version>${jetty.version}</version>
125         </dependency>
126         <dependency>
127             <groupId>org.eclipse.jetty</groupId>
128             <artifactId>jetty-http</artifactId>
129             <version>${jetty.version}</version>
130         </dependency>
131         <dependency>
132             <groupId>org.eclipse.jetty</groupId>
133             <artifactId>jetty-security</artifactId>
134             <version>${jetty.version}</version>
135         </dependency>
136         <dependency>
137             <groupId>org.eclipse.jetty</groupId>
138             <artifactId>jetty-websocket</artifactId>
139             <version>${jetty.websocket.version}</version>
140         </dependency>
141         <dependency>
142             <groupId>org.eclipse.jetty</groupId>
143             <artifactId>jetty-io</artifactId>
144             <version>${jetty.version}</version>
145         </dependency>
146         <dependency>
147             <groupId>org.apache.commons</groupId>
148             <artifactId>commons-io</artifactId>
149             <version>1.3.2</version>
150         </dependency>
151         <dependency>
152             <groupId>commons-lang</groupId>
153             <artifactId>commons-lang</artifactId>
154             <version>2.4</version>
155         </dependency>
156         <dependency>
157             <groupId>commons-io</groupId>
158             <artifactId>commons-io</artifactId>
159             <version>2.1</version>
160             <scope>compile</scope>
161         </dependency>
162         <dependency>
163             <groupId>org.apache.httpcomponents</groupId>
164             <artifactId>httpcore</artifactId>
165             <version>4.4</version>
166         </dependency>
167         <dependency>
168             <groupId>org.mozilla</groupId>
169             <artifactId>rhino</artifactId>
170             <version>1.7R3</version>
171         </dependency>
172         <dependency>
173             <groupId>org.apache.james</groupId>
174             <artifactId>apache-mime4j-core</artifactId>
175             <version>0.7</version>
176         </dependency>
177         <dependency>
178             <groupId>org.apache.httpcomponents</groupId>
179             <artifactId>httpclient</artifactId>
180             <version>4.5.3</version>
181         </dependency>
182         <dependency>
183             <groupId>org.sonatype.http-testing-harness</groupId>
184             <artifactId>junit-runner</artifactId>
185             <version>0.11</version>
186             <exclusions>
187                 <exclusion>
188                     <groupId>org.databene</groupId>
189                     <artifactId>contiperf</artifactId>
190                 </exclusion>
191             </exclusions>
192         </dependency>
193         <dependency>
194             <groupId>log4j</groupId>
195             <artifactId>log4j</artifactId>
196             <version>1.2.17</version>
197             <scope>compile</scope>
198         </dependency>
199         <dependency>
200             <groupId>org.mockito</groupId>
201             <artifactId>mockito-core</artifactId>
202             <version>1.10.19</version>
203             <scope>test</scope>
204         </dependency>
205         <dependency>
206             <groupId>org.powermock</groupId>
207             <artifactId>powermock-module-junit4</artifactId>
208             <version>1.6.4</version>
209             <scope>test</scope>
210         </dependency>
211         <dependency>
212             <groupId>org.powermock</groupId>
213             <artifactId>powermock-api-mockito</artifactId>
214             <version>1.6.4</version>
215             <scope>test</scope>
216         </dependency>
217         <dependency>
218             <groupId>org.apache.commons</groupId>
219             <artifactId>commons-lang3</artifactId>
220             <version>3.0</version>
221         </dependency>
222     </dependencies>
223     <profiles>
224         <profile>
225             <id>docker</id>
226             <properties>
227                 <skipDockerBuild>false</skipDockerBuild>
228                 <skipDockerTag>false</skipDockerTag>
229                 <skipTests>true</skipTests>
230             </properties>
231             <build>
232                 <plugins>
233
234                     <!-- Setup image tags per https://wiki.onap.org/display/DW/Independent+Versioning+and+Release+Process#IndependentVersioningandReleaseProcess-StandardizedDockerTagging -->
235                     <plugin>
236                       <groupId>org.codehaus.groovy.maven</groupId>
237                       <artifactId>gmaven-plugin</artifactId>
238                       <executions>
239                           <execution>
240                               <phase>validate</phase>
241                               <goals>
242                                   <goal>execute</goal>
243                               </goals>
244                               <configuration>
245                                   <properties>
246                                       <ver>${project.version}</ver>
247                                       <timestamp>${maven.build.timestamp}</timestamp>
248                                   </properties>
249                                   <source>
250                                       println 'ver: ' + project.properties['ver'];
251                                       if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
252                                           project.properties['dockertag1']=project.properties['ver'] + "-latest";
253                                           project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
254                                       } else {
255                                           project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest";
256                                           project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
257                                       }
258                                       println 'docker tag 1: ' + project.properties['dockertag1'];
259                                       println 'docker tag 2: ' + project.properties['dockertag2'];
260                                   </source>
261                               </configuration>
262                           </execution>
263                       </executions>
264                     </plugin>
265                     <plugin>
266                         <groupId>io.fabric8</groupId>
267                         <artifactId>docker-maven-plugin</artifactId>
268                         <version>0.28.0</version>
269                         <configuration>
270                             <verbose>${docker.verbose}</verbose>
271                             <apiVersion>${docker.apiVersion}</apiVersion>
272                             <pullRegistry>${docker.pull.registry}</pullRegistry>
273                             <pushRegistry>${docker.push.registry}</pushRegistry>
274                             <images>
275                                 <image>
276                                     <name>${datarouter.node.image.name}</name>
277                                     <build>
278                                         <cleanup>try</cleanup>
279                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
280                                         <dockerFile>Dockerfile</dockerFile>
281                                         <tags>
282                                             <tag>${dockertag1}</tag>
283                                             <tag>${dockertag2}</tag>
284                                         </tags>
285                                     </build>
286                                 </image>
287                             </images>
288                         </configuration>
289                          <executions>
290                              <execution>
291                                  <id>generate-images</id>
292                                  <phase>install</phase>
293                                  <goals>
294                                      <goal>build</goal>
295                                  </goals>
296                              </execution>
297                              <execution>
298                                  <id>push-images</id>
299                                  <phase>deploy</phase>
300                                  <goals>
301                                      <goal>push</goal>
302                                  </goals>
303                              </execution>
304                          </executions>
305                     </plugin>
306                 </plugins>
307             </build>
308         </profile>
309     </profiles>
310
311     <build>
312         <finalName>datarouter-node</finalName>
313         <resources>
314             <resource>
315                 <directory>src/main/resources</directory>
316                 <filtering>true</filtering>
317                 <includes>
318                     <include>**/*.properties</include>
319                 </includes>
320             </resource>
321             <resource>
322                 <directory>src/main/resources</directory>
323                 <filtering>true</filtering>
324                 <includes>
325                     <include>**/EelfMessages.properties</include>
326                 </includes>
327             </resource>
328             <resource>
329                 <directory>src/main/resources</directory>
330                 <filtering>true</filtering>
331                 <includes>
332                     <include>**/log4j.properties</include>
333                 </includes>
334             </resource>
335         </resources>
336         <plugins>
337             <plugin>
338                 <groupId>org.apache.maven.plugins</groupId>
339                 <artifactId>maven-compiler-plugin</artifactId>
340                 <configuration>
341                     <source>1.8</source>
342                     <target>1.8</target>
343                 </configuration>
344                 <version>3.6.0</version>
345             </plugin>
346             <plugin>
347                 <artifactId>maven-assembly-plugin</artifactId>
348                 <version>2.4</version>
349                 <configuration>
350                     <descriptorRefs>
351                         <descriptorRef>jar-with-dependencies</descriptorRef>
352                     </descriptorRefs>
353                     <outputDirectory>${basedir}/target/docker-stage/opt/app/datartr/lib</outputDirectory>
354                     <archive>
355                         <manifest>
356                             <addClasspath>true</addClasspath>
357                             <mainClass>org.onap.dmaap.datarouter.node.NodeMain</mainClass>
358                         </manifest>
359                     </archive>
360                 </configuration>
361                 <executions>
362                     <execution>
363                         <id>make-assembly</id>
364                         <!-- this is used for inheritance merges -->
365                         <phase>package</phase>
366                         <!-- bind to the packaging phase -->
367                         <goals>
368                             <goal>single</goal>
369                         </goals>
370                     </execution>
371                 </executions>
372             </plugin>
373             <plugin>
374                 <groupId>org.apache.maven.plugins</groupId>
375                 <artifactId>maven-resources-plugin</artifactId>
376                 <version>2.7</version>
377                 <executions>
378                     <execution>
379                         <id>copy-docker-file</id>
380                         <phase>validate</phase>
381                         <goals>
382                             <goal>copy-resources</goal>
383                         </goals>
384                         <configuration>
385                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
386                             <overwrite>true</overwrite>
387                             <resources>
388                                 <resource>
389                                     <directory>${basedir}/src/main/resources/docker</directory>
390                                     <filtering>true</filtering>
391                                     <includes>
392                                         <include>**/*</include>
393                                     </includes>
394                                 </resource>
395                             </resources>
396                         </configuration>
397                     </execution>
398                     <execution>
399                         <id>copy-startup-script</id>
400                         <phase>validate</phase>
401                         <goals>
402                             <goal>copy-resources</goal>
403                         </goals>
404                         <configuration>
405                             <outputDirectory>${basedir}/target/docker-stage/opt</outputDirectory>
406                             <overwrite>true</overwrite>
407                             <resources>
408                                 <resource>
409                                     <directory>${basedir}/src/main/resources/docker</directory>
410                                     <filtering>true</filtering>
411                                     <includes>
412                                         <include>startup.sh</include>
413                                     </includes>
414                                 </resource>
415                             </resources>
416                         </configuration>
417                     </execution>
418                     <execution>
419                         <id>copy-resources-2</id>
420                         <phase>validate</phase>
421                         <goals>
422                             <goal>copy-resources</goal>
423                         </goals>
424                         <configuration>
425                             <outputDirectory>${basedir}/target/docker-stage/opt/app/datartr/etc</outputDirectory>
426                             <resources>
427                                 <resource>
428                                     <directory>${basedir}/src/main/resources</directory>
429                                     <includes>
430                                         <include>misc/**</include>
431                                         <include>**/**</include>
432                                     </includes>
433                                 </resource>
434                             </resources>
435                         </configuration>
436                     </execution>
437                     <execution>
438                         <id>copy-resources-3</id>
439                         <phase>validate</phase>
440                         <goals>
441                             <goal>copy-resources</goal>
442                         </goals>
443                         <configuration>
444                             <outputDirectory>${basedir}/target/docker-stage/opt/app/datartr</outputDirectory>
445                             <resources>
446                                 <resource>
447                                     <directory>${basedir}/data</directory>
448                                     <includes>
449                                         <include>misc/**</include>
450                                         <include>**/**</include>
451                                     </includes>
452                                 </resource>
453                             </resources>
454                         </configuration>
455                     </execution>
456                     <execution>
457                         <id>copy-resources-4</id>
458                         <phase>validate</phase>
459                         <goals>
460                             <goal>copy-resources</goal>
461                         </goals>
462                         <configuration>
463                             <outputDirectory>${basedir}/target/docker-stage/opt/app/datartr/aaf_certs</outputDirectory>
464                             <resources>
465                                 <resource>
466                                     <directory>${basedir}/aaf_certs</directory>
467                                     <includes>
468                                         <include>misc/**</include>
469                                         <include>**/**</include>
470                                     </includes>
471                                 </resource>
472                             </resources>
473                         </configuration>
474                     </execution>
475                 </executions>
476             </plugin>
477             <plugin>
478                 <groupId>org.apache.maven.plugins</groupId>
479                 <artifactId>maven-dependency-plugin</artifactId>
480                 <version>2.10</version>
481                 <executions>
482                     <execution>
483                         <id>copy-dependencies</id>
484                         <phase>package</phase>
485                         <goals>
486                             <goal>copy-dependencies</goal>
487                         </goals>
488                         <configuration>
489                             <outputDirectory>${project.build.directory}/docker-stage/opt/app/datartr/lib</outputDirectory>
490                             <overWriteReleases>false</overWriteReleases>
491                             <overWriteSnapshots>false</overWriteSnapshots>
492                             <overWriteIfNewer>true</overWriteIfNewer>
493                         </configuration>
494                     </execution>
495                 </executions>
496             </plugin>
497             <plugin>
498                 <groupId>org.apache.maven.plugins</groupId>
499                 <artifactId>maven-javadoc-plugin</artifactId>
500                 <configuration>
501                     <failOnError>false</failOnError>
502                 </configuration>
503                 <executions>
504                     <execution>
505                         <id>attach-javadocs</id>
506                         <goals>
507                             <goal>jar</goal>
508                         </goals>
509                     </execution>
510                 </executions>
511             </plugin>
512             <plugin>
513                 <groupId>org.apache.maven.plugins</groupId>
514                 <artifactId>maven-source-plugin</artifactId>
515                 <version>2.2.1</version>
516                 <executions>
517                     <execution>
518                         <id>attach-sources</id>
519                         <goals>
520                             <goal>jar-no-fork</goal>
521                         </goals>
522                     </execution>
523                 </executions>
524             </plugin>
525             <plugin>
526                 <groupId>org.codehaus.mojo</groupId>
527                 <artifactId>cobertura-maven-plugin</artifactId>
528                 <version>2.7</version>
529                 <configuration>
530                     <formats>
531                         <format>html</format>
532                         <format>xml</format>
533                     </formats>
534                     <check/>
535                 </configuration>
536             </plugin>
537             <plugin>
538                 <groupId>org.sonatype.plugins</groupId>
539                 <artifactId>nexus-staging-maven-plugin</artifactId>
540                 <version>1.6.7</version>
541                 <extensions>true</extensions>
542                 <configuration>
543                     <nexusUrl>${onap.nexus.url}</nexusUrl>
544                     <stagingProfileId>176c31dfe190a</stagingProfileId>
545                     <serverId>ecomp-staging</serverId>
546                 </configuration>
547             </plugin>
548             <plugin>
549                 <groupId>org.jacoco</groupId>
550                 <artifactId>jacoco-maven-plugin</artifactId>
551                 <version>${jacoco.version}</version>
552                 <configuration>
553                     <excludes>
554                         <exclude>**/gen/**</exclude>
555                         <exclude>**/generated-sources/**</exclude>
556                         <exclude>**/yang-gen/**</exclude>
557                         <exclude>**/pax/**</exclude>
558                     </excludes>
559                 </configuration>
560                 <executions>
561                     <execution>
562                         <id>pre-unit-test</id>
563                         <goals>
564                             <goal>prepare-agent</goal>
565                         </goals>
566                         <configuration>
567                             <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
568                             <propertyName>surefireArgLine</propertyName>
569                         </configuration>
570                     </execution>
571                     <execution>
572                         <id>post-unit-test</id>
573                         <phase>test</phase>
574                         <goals>
575                             <goal>report</goal>
576                         </goals>
577                         <configuration>
578                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
579                             <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
580                         </configuration>
581                     </execution>
582                     <execution>
583                         <id>pre-integration-test</id>
584                         <phase>pre-integration-test</phase>
585                         <goals>
586                             <goal>prepare-agent</goal>
587                         </goals>
588                         <configuration>
589                             <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
590                             <propertyName>failsafeArgLine</propertyName>
591                         </configuration>
592                     </execution>
593                     <execution>
594                         <id>post-integration-test</id>
595                         <phase>post-integration-test</phase>
596                         <goals>
597                             <goal>report</goal>
598                         </goals>
599                         <configuration>
600                             <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
601                             <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
602                         </configuration>
603                     </execution>
604                 </executions>
605             </plugin>
606         </plugins>
607     </build>
608 </project>