Unify DMaaP Data Router image creation
[dmaap/datarouter.git] / datarouter-subscriber / 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-subscriber</artifactId>
33     <packaging>jar</packaging>
34     <name>datarouter-subscriber</name>
35     <properties>
36         <sonar.language>java</sonar.language>
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
41         <docker.location>${basedir}/target/${artifactId}</docker.location>
42         <datarouter.prov.image.name>onap/dmaap/datarouter-subscriber</datarouter.prov.image.name>
43     </properties>
44     <dependencies>
45         <dependency>
46             <groupId>com.google.guava</groupId>
47             <artifactId>guava</artifactId>
48             <version>${google.guava.version}</version>
49         </dependency>
50         <dependency>
51             <groupId>commons-codec</groupId>
52             <artifactId>commons-codec</artifactId>
53             <version>${commons-codec.version}</version>
54         </dependency>
55         <dependency>
56             <groupId>org.eclipse.jetty</groupId>
57             <artifactId>jetty-server</artifactId>
58             <version>${jetty.version}</version>
59         </dependency>
60         <dependency>
61             <groupId>org.eclipse.jetty</groupId>
62             <artifactId>jetty-continuation</artifactId>
63             <version>${jetty.version}</version>
64         </dependency>
65         <dependency>
66             <groupId>org.eclipse.jetty</groupId>
67             <artifactId>jetty-util</artifactId>
68             <version>${jetty.version}</version>
69         </dependency>
70         <dependency>
71             <groupId>org.eclipse.jetty</groupId>
72             <artifactId>jetty-deploy</artifactId>
73             <version>${jetty.version}</version>
74         </dependency>
75         <dependency>
76             <groupId>org.eclipse.jetty</groupId>
77             <artifactId>jetty-servlet</artifactId>
78             <version>${jetty.version}</version>
79         </dependency>
80         <dependency>
81             <groupId>org.eclipse.jetty</groupId>
82             <artifactId>jetty-servlets</artifactId>
83             <version>${jetty.version}</version>
84         </dependency>
85         <dependency>
86             <groupId>org.eclipse.jetty</groupId>
87             <artifactId>jetty-http</artifactId>
88             <version>${jetty.version}</version>
89         </dependency>
90         <dependency>
91             <groupId>org.eclipse.jetty</groupId>
92             <artifactId>jetty-security</artifactId>
93             <version>${jetty.version}</version>
94         </dependency>
95         <dependency>
96             <groupId>org.eclipse.jetty</groupId>
97             <artifactId>jetty-websocket</artifactId>
98             <version>${jetty.websocket.version}</version>
99         </dependency>
100         <dependency>
101             <groupId>org.eclipse.jetty</groupId>
102             <artifactId>jetty-io</artifactId>
103             <version>${jetty.version}</version>
104         </dependency>
105         <dependency>
106             <groupId>com.thoughtworks.xstream</groupId>
107             <artifactId>xstream</artifactId>
108             <version>${thoughtworks.version}</version>
109         </dependency>
110         <dependency>
111             <groupId>ch.qos.logback</groupId>
112             <artifactId>logback-classic</artifactId>
113             <version>${qos.logback.version}</version>
114             <scope>compile</scope>
115         </dependency>
116         <dependency>
117             <groupId>ch.qos.logback</groupId>
118             <artifactId>logback-core</artifactId>
119             <version>${qos.logback.version}</version>
120             <scope>compile</scope>
121         </dependency>
122         <dependency>
123             <groupId>org.apache.httpcomponents</groupId>
124             <artifactId>httpclient</artifactId>
125             <version>4.5.3</version>
126         </dependency>
127         <dependency>
128             <groupId>org.sonatype.http-testing-harness</groupId>
129             <artifactId>junit-runner</artifactId>
130             <version>0.11</version>
131             <exclusions>
132                 <exclusion>
133                     <groupId>org.databene</groupId>
134                     <artifactId>contiperf</artifactId>
135                 </exclusion>
136             </exclusions>
137         </dependency>
138         <dependency>
139             <groupId>junit</groupId>
140             <artifactId>junit</artifactId>
141             <version>4.10</version>
142             <scope>test</scope>
143         </dependency>
144         <dependency>
145             <groupId>log4j</groupId>
146             <artifactId>log4j</artifactId>
147             <version>1.2.17</version>
148             <scope>compile</scope>
149         </dependency>
150         <dependency>
151             <groupId>org.apache.commons</groupId>
152             <artifactId>commons-io</artifactId>
153             <version>1.3.2</version>
154         </dependency>
155     </dependencies>
156     <profiles>
157         <profile>
158             <id>docker</id>
159             <properties>
160                 <skipDockerBuild>false</skipDockerBuild>
161                 <skipDockerTag>false</skipDockerTag>
162                 <skipTests>true</skipTests>
163             </properties>
164             <build>
165                 <plugins>
166                     <plugin>
167                         <groupId>com.spotify</groupId>
168                         <artifactId>docker-maven-plugin</artifactId>
169                         <version>${docker.maven.plugin.version}</version>
170                         <configuration>
171                             <imageName>${onap.nexus.dockerregistry.daily}/${datarouter.prov.image.name}</imageName>
172                             <baseImage>java:8</baseImage>
173                             <serverId>${onap.nexus.dockerregistry.daily}</serverId>
174                             <skipDockerBuild>false</skipDockerBuild>
175                             <imageTags>
176                                 <imageTag>${project.version}</imageTag>
177                                 <imageTag>latest</imageTag>
178                             </imageTags>
179                             <forceTags>true</forceTags>
180                             <entryPoint>["/startup.sh", "start"]</entryPoint>
181                             <resources>
182                                 <resource>
183                                     <targetPath>/opt</targetPath>
184                                     <directory>${project.build.directory}/opt</directory>
185                                 </resource>
186                                 <resource>
187                                     <targetPath>/</targetPath>
188                                     <directory>${docker.location}</directory>
189                                     <include>startup.sh</include>
190                                 </resource>
191                             </resources>
192                             <runs>
193                                 <run>chmod 0700 /startup.sh</run>
194                             </runs>
195                             <exposes>
196                                 <expose>8080</expose>
197                                 <expose>8443</expose>
198                             </exposes>
199                         </configuration>
200                     </plugin>
201                 </plugins>
202             </build>
203         </profile>
204     </profiles>
205     <build>
206         <finalName>datarouter-subscriber</finalName>
207         <resources>
208             <resource>
209                 <directory>src/main/resources</directory>
210                 <filtering>true</filtering>
211                 <includes>
212                     <include>**/*.properties</include>
213                 </includes>
214             </resource>
215             <resource>
216                 <directory>src/main/resources</directory>
217                 <filtering>true</filtering>
218                 <includes>
219                     <include>**/subscriber.properties</include>
220                 </includes>
221             </resource>
222             <resource>
223                 <directory>src/main/resources</directory>
224                 <filtering>true</filtering>
225                 <includes>
226                     <include>**/log4j.properties</include>
227                 </includes>
228             </resource>
229             <resource>
230                 <directory>src/test/resources</directory>
231                 <filtering>true</filtering>
232                 <includes>
233                     <include>**/log4j.properties</include>
234                 </includes>
235             </resource>
236         </resources>
237         <plugins>
238             <plugin>
239                 <artifactId>maven-assembly-plugin</artifactId>
240                 <version>2.4</version>
241                 <configuration>
242                     <descriptorRefs>
243                         <descriptorRef>jar-with-dependencies</descriptorRef>
244                     </descriptorRefs>
245                     <outputDirectory>${basedir}/target/opt/app/subscriber/lib</outputDirectory>
246                     <archive>
247                         <manifest>
248                             <addClasspath>true</addClasspath>
249                             <mainClass>org.onap.dmaap.datarouter.subscriber.SubscriberMain</mainClass>
250                         </manifest>
251                     </archive>
252                 </configuration>
253                 <executions>
254                     <execution>
255                         <id>make-assembly</id>
256                         <!-- this is used for inheritance merges -->
257                         <phase>package</phase>
258                         <!-- bind to the packaging phase -->
259                         <goals>
260                             <goal>single</goal>
261                         </goals>
262                     </execution>
263                 </executions>
264             </plugin>
265             <plugin>
266                 <groupId>org.apache.maven.plugins</groupId>
267                 <artifactId>maven-compiler-plugin</artifactId>
268                 <configuration>
269                     <source>1.8</source>
270                     <target>1.8</target>
271                 </configuration>
272                 <version>3.6.0</version>
273             </plugin>
274             <plugin>
275                 <artifactId>maven-resources-plugin</artifactId>
276                 <version>2.7</version>
277                 <executions>
278                     <execution>
279                         <id>copy-docker-file</id>
280                         <phase>package</phase>
281                         <goals>
282                             <goal>copy-resources</goal>
283                         </goals>
284                         <configuration>
285                             <outputDirectory>${docker.location}</outputDirectory>
286                             <overwrite>true</overwrite>
287                             <resources>
288                                 <resource>
289                                     <directory>${basedir}/src/main/resources/docker</directory>
290                                     <filtering>true</filtering>
291                                     <includes>
292                                         <include>**/*</include>
293                                     </includes>
294                                 </resource>
295                             </resources>
296                         </configuration>
297                     </execution>
298                     <execution>
299                         <id>copy-resources-1</id>
300                         <phase>validate</phase>
301                         <goals>
302                             <goal>copy-resources</goal>
303                         </goals>
304                         <configuration>
305                             <outputDirectory>${basedir}/target/opt/app/subscriber/lib</outputDirectory>
306                             <resources>
307                                 <resource>
308                                     <directory>${project.basedir}/src/main/resources</directory>
309                                     <includes>
310                                         <include>**/*.jar</include>
311                                     </includes>
312                                 </resource>
313                             </resources>
314                         </configuration>
315                     </execution>
316                     <execution>
317                         <id>copy-resources-2</id>
318                         <phase>validate</phase>
319                         <goals>
320                             <goal>copy-resources</goal>
321                         </goals>
322                         <configuration>
323                             <outputDirectory>${basedir}/target/opt/app/subscriber/etc</outputDirectory>
324                             <resources>
325                                 <resource>
326                                     <directory>${basedir}/src/main/resources</directory>
327                                     <includes>
328                                         <include>*.properties</include>
329                                     </includes>
330                                 </resource>
331                             </resources>
332                         </configuration>
333                     </execution>
334                 </executions>
335             </plugin>
336             <plugin>
337                 <groupId>org.apache.maven.plugins</groupId>
338                 <artifactId>maven-dependency-plugin</artifactId>
339                 <version>2.10</version>
340                 <executions>
341                     <execution>
342                         <id>copy-dependencies</id>
343                         <phase>package</phase>
344                         <goals>
345                             <goal>copy-dependencies</goal>
346                         </goals>
347                         <configuration>
348                             <outputDirectory>${project.build.directory}/opt/app/subscriber/lib</outputDirectory>
349                             <overWriteReleases>false</overWriteReleases>
350                             <overWriteSnapshots>false</overWriteSnapshots>
351                             <overWriteIfNewer>true</overWriteIfNewer>
352                         </configuration>
353                     </execution>
354                 </executions>
355             </plugin>
356             <plugin>
357                 <groupId>org.apache.maven.plugins</groupId>
358                 <artifactId>maven-source-plugin</artifactId>
359                 <version>2.2.1</version>
360                 <executions>
361                     <execution>
362                         <id>attach-sources</id>
363                         <goals>
364                             <goal>jar-no-fork</goal>
365                         </goals>
366                     </execution>
367                 </executions>
368             </plugin>
369             <plugin>
370                 <groupId>org.jacoco</groupId>
371                 <artifactId>jacoco-maven-plugin</artifactId>
372                 <version>${jacoco.version}</version>
373                 <configuration>
374                     <excludes>
375                         <exclude>**/gen/**</exclude>
376                         <exclude>**/generated-sources/**</exclude>
377                         <exclude>**/yang-gen/**</exclude>
378                         <exclude>**/pax/**</exclude>
379                     </excludes>
380                 </configuration>
381                 <executions>
382                     <execution>
383                         <id>pre-unit-test</id>
384                         <goals>
385                             <goal>prepare-agent</goal>
386                         </goals>
387                         <configuration>
388                             <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
389                             <propertyName>surefireArgLine</propertyName>
390                         </configuration>
391                     </execution>
392                     <execution>
393                         <id>post-unit-test</id>
394                         <phase>test</phase>
395                         <goals>
396                             <goal>report</goal>
397                         </goals>
398                         <configuration>
399                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
400                             <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
401                         </configuration>
402                     </execution>
403                     <execution>
404                         <id>pre-integration-test</id>
405                         <phase>pre-integration-test</phase>
406                         <goals>
407                             <goal>prepare-agent</goal>
408                         </goals>
409                         <configuration>
410                             <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
411                             <propertyName>failsafeArgLine</propertyName>
412                         </configuration>
413                     </execution>
414                     <execution>
415                         <id>post-integration-test</id>
416                         <phase>post-integration-test</phase>
417                         <goals>
418                             <goal>report</goal>
419                         </goals>
420                         <configuration>
421                             <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
422                             <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
423                         </configuration>
424                     </execution>
425                 </executions>
426             </plugin>
427         </plugins>
428     </build>
429 </project>