Additional updates for Subscriber docker image
[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   * ===========================================================================
7   * Licensed under the Apache License, Version 2.0 (the "License");
8   * you may not use this file except in compliance with the License.
9   * You may obtain a copy of the License at
10   *
11    *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13    * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * ============LICENSE_END====================================================
19   *
20   * ECOMP is a trademark and service mark of AT&T Intellectual Property.
21   *
22 -->
23 <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">
24     <modelVersion>4.0.0</modelVersion>
25     <parent>
26         <groupId>org.onap.dmaap.datarouter</groupId>
27         <artifactId>parent</artifactId>
28         <version>1.0.1-SNAPSHOT</version>
29         <relativePath>../pom.xml</relativePath>
30     </parent>
31     <artifactId>datarouter-subscriber</artifactId>
32     <packaging>jar</packaging>
33     <name>datarouter-subscriber</name>
34     <properties>
35         <sonar.language>java</sonar.language>
36         <sonar.skip>false</sonar.skip>
37         <sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>
38         <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath>
39
40         <docker.location>${basedir}/target/${artifactId}</docker.location>
41         <datarouter.prov.image.name>onap/dmaap/datarouter-subscriber</datarouter.prov.image.name>
42     </properties>
43     <dependencies>
44         <dependency>
45             <groupId>org.eclipse.jetty</groupId>
46             <artifactId>jetty-server</artifactId>
47             <version>${jetty.version}</version>
48         </dependency>
49         <dependency>
50             <groupId>org.eclipse.jetty</groupId>
51             <artifactId>jetty-continuation</artifactId>
52             <version>${jetty.version}</version>
53         </dependency>
54         <dependency>
55             <groupId>org.eclipse.jetty</groupId>
56             <artifactId>jetty-util</artifactId>
57             <version>${jetty.version}</version>
58         </dependency>
59         <dependency>
60             <groupId>org.eclipse.jetty</groupId>
61             <artifactId>jetty-deploy</artifactId>
62             <version>${jetty.version}</version>
63         </dependency>
64         <dependency>
65             <groupId>org.eclipse.jetty</groupId>
66             <artifactId>jetty-servlet</artifactId>
67             <version>${jetty.version}</version>
68         </dependency>
69         <dependency>
70             <groupId>org.eclipse.jetty</groupId>
71             <artifactId>jetty-servlets</artifactId>
72             <version>${jetty.version}</version>
73         </dependency>
74         <dependency>
75             <groupId>org.eclipse.jetty</groupId>
76             <artifactId>jetty-http</artifactId>
77             <version>${jetty.version}</version>
78         </dependency>
79         <dependency>
80             <groupId>org.eclipse.jetty</groupId>
81             <artifactId>jetty-security</artifactId>
82             <version>${jetty.version}</version>
83         </dependency>
84         <dependency>
85             <groupId>org.eclipse.jetty</groupId>
86             <artifactId>jetty-websocket</artifactId>
87             <version>${jetty.websocket.version}</version>
88         </dependency>
89         <dependency>
90             <groupId>org.eclipse.jetty</groupId>
91             <artifactId>jetty-io</artifactId>
92             <version>${jetty.version}</version>
93         </dependency>
94         <dependency>
95             <groupId>org.apache.httpcomponents</groupId>
96             <artifactId>httpclient</artifactId>
97             <version>4.5.3</version>
98         </dependency>
99         <dependency>
100             <groupId>org.sonatype.http-testing-harness</groupId>
101             <artifactId>junit-runner</artifactId>
102             <version>0.11</version>
103             <exclusions>
104                 <exclusion>
105                     <groupId>org.databene</groupId>
106                     <artifactId>contiperf</artifactId>
107                 </exclusion>
108             </exclusions>
109         </dependency>
110         <dependency>
111             <groupId>junit</groupId>
112             <artifactId>junit</artifactId>
113             <version>4.10</version>
114             <scope>test</scope>
115         </dependency>
116         <dependency>
117             <groupId>log4j</groupId>
118             <artifactId>log4j</artifactId>
119             <version>1.2.17</version>
120             <scope>compile</scope>
121         </dependency>
122         <dependency>
123             <groupId>org.apache.commons</groupId>
124             <artifactId>commons-io</artifactId>
125             <version>1.3.2</version>
126         </dependency>
127     </dependencies>
128     <profiles>
129         <profile>
130             <id>docker</id>
131             <properties>
132                 <skipDockerBuild>false</skipDockerBuild>
133                 <skipDockerTag>false</skipDockerTag>
134                 <skipTests>true</skipTests>
135             </properties>
136             <build>
137                 <plugins>
138                     <plugin>
139                         <groupId>com.spotify</groupId>
140                         <artifactId>docker-maven-plugin</artifactId>
141                         <version>1.0.0</version>
142                         <configuration>
143                             <imageName>${onap.nexus.dockerregistry.daily}/${datarouter.prov.image.name}</imageName>
144                             <dockerDirectory>${docker.location}</dockerDirectory>
145                             <serverId>${onap.nexus.dockerregistry.daily}</serverId>
146                             <skipDockerBuild>false</skipDockerBuild>
147                             <imageTags>
148                                 <imageTag>${project.version}</imageTag>
149                                 <imageTag>latest</imageTag>
150                             </imageTags>
151                             <forceTags>true</forceTags>
152                             <resources>
153                                 <resource>
154                                     <targetPath>/</targetPath>
155                                     <directory>${project.basedir}</directory>
156                                     <excludes>
157                                         <exclude>target/**/*</exclude>
158                                         <exclude>pom.xml</exclude>
159                                     </excludes>
160                                 </resource>
161
162                                 <resource>
163                                     <targetPath>/</targetPath>
164                                     <directory>${project.build.directory}</directory>
165                                     <include>**/**</include>
166                                 </resource>
167                             </resources>
168                         </configuration>
169                     </plugin>
170                 </plugins>
171             </build>
172         </profile>
173     </profiles>
174     <build>
175         <finalName>datarouter-subscriber</finalName>
176         <resources>
177             <resource>
178                 <directory>src/main/resources</directory>
179                 <filtering>true</filtering>
180                 <includes>
181                     <include>**/*.properties</include>
182                 </includes>
183             </resource>
184             <resource>
185                 <directory>src/main/resources</directory>
186                 <filtering>true</filtering>
187                 <includes>
188                     <include>**/subscriber.properties</include>
189                 </includes>
190             </resource>
191             <resource>
192                 <directory>src/main/resources</directory>
193                 <filtering>true</filtering>
194                 <includes>
195                     <include>**/log4j.properties</include>
196                 </includes>
197             </resource>
198             <resource>
199                 <directory>src/test/resources</directory>
200                 <filtering>true</filtering>
201                 <includes>
202                     <include>**/log4j.properties</include>
203                 </includes>
204             </resource>
205         </resources>
206         <plugins>
207             <plugin>
208                 <artifactId>maven-assembly-plugin</artifactId>
209                 <version>2.4</version>
210                 <configuration>
211                     <descriptorRefs>
212                         <descriptorRef>jar-with-dependencies</descriptorRef>
213                     </descriptorRefs>
214                     <outputDirectory>${basedir}/target/opt/app/subscriber/lib</outputDirectory>
215                     <archive>
216                         <manifest>
217                             <addClasspath>true</addClasspath>
218                             <mainClass>org.onap.dmaap.datarouter.subscriber.SubscriberMain</mainClass>
219                         </manifest>
220                     </archive>
221                 </configuration>
222                 <executions>
223                     <execution>
224                         <id>make-assembly</id>
225                         <!-- this is used for inheritance merges -->
226                         <phase>package</phase>
227                         <!-- bind to the packaging phase -->
228                         <goals>
229                             <goal>single</goal>
230                         </goals>
231                     </execution>
232                 </executions>
233             </plugin>
234             <plugin>
235                 <groupId>org.apache.maven.plugins</groupId>
236                 <artifactId>maven-compiler-plugin</artifactId>
237                 <configuration>
238                     <source>1.8</source>
239                     <target>1.8</target>
240                 </configuration>
241                 <version>3.6.0</version>
242             </plugin>
243             <plugin>
244                 <artifactId>maven-resources-plugin</artifactId>
245                 <version>2.7</version>
246                 <executions>
247                     <execution>
248                         <id>copy-docker-file</id>
249                         <phase>package</phase>
250                         <goals>
251                             <goal>copy-resources</goal>
252                         </goals>
253                         <configuration>
254                             <outputDirectory>${docker.location}</outputDirectory>
255                             <overwrite>true</overwrite>
256                             <resources>
257                                 <resource>
258                                     <directory>${basedir}/src/main/resources/docker</directory>
259                                     <filtering>true</filtering>
260                                     <includes>
261                                         <include>**/*</include>
262                                     </includes>
263                                 </resource>
264                             </resources>
265                         </configuration>
266                     </execution>
267                     <execution>
268                         <id>copy-resources-1</id>
269                         <phase>validate</phase>
270                         <goals>
271                             <goal>copy-resources</goal>
272                         </goals>
273                         <configuration>
274                             <outputDirectory>${basedir}/target/opt/app/subscriber/lib</outputDirectory>
275                             <resources>
276                                 <resource>
277                                     <directory>${project.basedir}/src/main/resources</directory>
278                                     <includes>
279                                         <include>**/*.jar</include>
280                                     </includes>
281                                 </resource>
282                             </resources>
283                         </configuration>
284                     </execution>
285                     <execution>
286                         <id>copy-resources-2</id>
287                         <phase>validate</phase>
288                         <goals>
289                             <goal>copy-resources</goal>
290                         </goals>
291                         <configuration>
292                             <outputDirectory>${basedir}/target/opt/app/subscriber/etc</outputDirectory>
293                             <resources>
294                                 <resource>
295                                     <directory>${basedir}/src/main/resources</directory>
296                                     <includes>
297                                         <include>*.properties</include>
298                                     </includes>
299                                 </resource>
300                             </resources>
301                         </configuration>
302                     </execution>
303                 </executions>
304             </plugin>
305             <plugin>
306                 <groupId>org.apache.maven.plugins</groupId>
307                 <artifactId>maven-dependency-plugin</artifactId>
308                 <version>2.10</version>
309                 <executions>
310                     <execution>
311                         <id>copy-dependencies</id>
312                         <phase>package</phase>
313                         <goals>
314                             <goal>copy-dependencies</goal>
315                         </goals>
316                         <configuration>
317                             <outputDirectory>${project.build.directory}/opt/app/subscriber/lib</outputDirectory>
318                             <overWriteReleases>false</overWriteReleases>
319                             <overWriteSnapshots>false</overWriteSnapshots>
320                             <overWriteIfNewer>true</overWriteIfNewer>
321                         </configuration>
322                     </execution>
323                 </executions>
324             </plugin>
325             <plugin>
326                 <groupId>org.apache.maven.plugins</groupId>
327                 <artifactId>maven-source-plugin</artifactId>
328                 <version>2.2.1</version>
329                 <executions>
330                     <execution>
331                         <id>attach-sources</id>
332                         <goals>
333                             <goal>jar-no-fork</goal>
334                         </goals>
335                     </execution>
336                 </executions>
337             </plugin>
338             <plugin>
339                 <groupId>org.jacoco</groupId>
340                 <artifactId>jacoco-maven-plugin</artifactId>
341                 <version>${jacoco.version}</version>
342                 <configuration>
343                     <excludes>
344                         <exclude>**/gen/**</exclude>
345                         <exclude>**/generated-sources/**</exclude>
346                         <exclude>**/yang-gen/**</exclude>
347                         <exclude>**/pax/**</exclude>
348                     </excludes>
349                 </configuration>
350                 <executions>
351                     <execution>
352                         <id>pre-unit-test</id>
353                         <goals>
354                             <goal>prepare-agent</goal>
355                         </goals>
356                         <configuration>
357                             <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
358                             <propertyName>surefireArgLine</propertyName>
359                         </configuration>
360                     </execution>
361                     <execution>
362                         <id>post-unit-test</id>
363                         <phase>test</phase>
364                         <goals>
365                             <goal>report</goal>
366                         </goals>
367                         <configuration>
368                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
369                             <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
370                         </configuration>
371                     </execution>
372                     <execution>
373                         <id>pre-integration-test</id>
374                         <phase>pre-integration-test</phase>
375                         <goals>
376                             <goal>prepare-agent</goal>
377                         </goals>
378                         <configuration>
379                             <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
380                             <propertyName>failsafeArgLine</propertyName>
381                         </configuration>
382                     </execution>
383                     <execution>
384                         <id>post-integration-test</id>
385                         <phase>post-integration-test</phase>
386                         <goals>
387                             <goal>report</goal>
388                         </goals>
389                         <configuration>
390                             <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
391                             <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
392                         </configuration>
393                     </execution>
394                 </executions>
395             </plugin>
396         </plugins>
397     </build>
398 </project>