confluent based image
[dmaap/kafka11aaf.git] / pom.xml
1 <!-- ============LICENSE_START======================================================= 
2         org.onap.dmaap ================================================================================ 
3         Copyright Â© 2017 AT&T Intellectual Property. All rights reserved. ================================================================================ 
4         Licensed under the Apache License, Version 2.0 (the "License"); you may not 
5         use this file except in compliance with the License. You may obtain a copy 
6         of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
7         by applicable law or agreed to in writing, software distributed under the 
8         License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
9         OF ANY KIND, either express or implied. See the License for the specific 
10         language governing permissions and limitations under the License. ============LICENSE_END========================================================= 
11         ECOMP is a trademark and service mark of AT&T Intellectual Property. -->
12 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
13         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
14         <modelVersion>4.0.0</modelVersion>
15
16         <parent>
17                 <groupId>org.onap.oparent</groupId>
18                 <artifactId>oparent</artifactId>
19                 <version>2.1.0</version>
20         </parent>
21
22         <groupId>org.onap.dmaap.kafka</groupId>
23         <artifactId>kafka11aaf</artifactId>
24         <version>1.0.3-SNAPSHOT</version>
25         <name>dmaap-kafka</name>
26         <licenses>
27                 <license>
28                         <name>Apache License Version 2.0</name>
29                 </license>
30         </licenses>
31
32         <developers>
33                 <developer>
34                         <name>Sunil Unnava</name>
35                         <email></email>
36                         <organization>ATT</organization>
37                         <organizationUrl>www.att.com</organizationUrl>
38                 </developer>
39         </developers>
40
41         <build>
42                 <!-- Copy files to docker-stage to be included in image -->
43         <resources>
44                         <resource>
45                                 <targetPath>${basedir}/target/docker-stage</targetPath>
46                                 <directory>${basedir}/src/main/docker</directory>
47                                         </resource>
48                         <resource>
49                                 <directory>${basedir}/src/main/resources</directory>
50                         </resource>
51                 
52
53                 </resources> 
54                 <plugins>
55                         <plugin>
56                                 <groupId>org.apache.maven.plugins</groupId>
57                                 <artifactId>maven-surefire-plugin</artifactId>
58                                 <version>2.12.4</version>
59                                 <configuration>
60                                         <excludes>
61                                                 <!-- exclude until junits updated <exclude>**/DME2*.java</exclude> -->
62                                         </excludes>
63                                         <!-- <skipTests>true</skipTests> -->
64                                 </configuration>
65                         </plugin>
66                         <plugin>
67                                 <groupId>org.codehaus.mojo</groupId>
68                                 <artifactId>cobertura-maven-plugin</artifactId>
69                                 <version>2.7</version>
70                                 <configuration>
71                                         <formats>
72                                                 <format>html</format>
73                                                 <format>xml</format>
74                                         </formats>
75                                 </configuration>
76                         </plugin>
77                         <plugin>
78                                 <groupId>org.apache.maven.plugins</groupId>
79                                 <artifactId>maven-site-plugin</artifactId>
80                                 <version>3.6</version>
81                                 <dependencies>
82                                         <dependency>
83                                                 <groupId>org.apache.maven.wagon</groupId>
84                                                 <artifactId>wagon-webdav-jackrabbit</artifactId>
85                                                 <version>2.10</version>
86                                         </dependency>
87                                 </dependencies>
88                         </plugin>
89
90                         <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> 
91                                 <version>3.0.2</version> </plugin> -->
92
93                         <plugin>
94                                 <groupId>org.apache.maven.plugins</groupId>
95                                 <artifactId>maven-source-plugin</artifactId>
96                                 <version>3.0.0</version>
97                                 <executions>
98                                         <execution>
99                                                 <id>attach-sources</id>
100                                                 <goals>
101                                                         <goal>jar-no-fork</goal>
102                                                 </goals>
103                                         </execution>
104                                 </executions>
105                         </plugin>
106                         <plugin>
107                                 <groupId>org.apache.maven.plugins</groupId>
108                                 <artifactId>maven-release-plugin</artifactId>
109                                 <version>2.5.3</version>
110                                 <configuration>
111                                         <autoVersionSubmodules>true</autoVersionSubmodules>
112                                         <checkModificationExcludes>
113                                         </checkModificationExcludes>
114                                 </configuration>
115                                 <dependencies>
116                                         <dependency>
117                                                 <groupId>org.apache.maven.scm</groupId>
118                                                 <artifactId>maven-scm-provider-gitexe</artifactId>
119                                                 <version>1.9.4</version>
120                                         </dependency>
121                                 </dependencies>
122                         </plugin>
123
124                         <plugin>
125                                 <artifactId>maven-deploy-plugin</artifactId>
126                                 <version>2.8</version>
127                                 <executions>
128                                         <execution>
129                                                 <id>default-deploy</id>
130                                                 <phase>none</phase>
131                                                 <configuration>
132                                                         <skip />
133                                                 </configuration>
134                                         </execution>
135                                 </executions>
136                                 <configuration>
137                                         <skip />
138                                 </configuration>
139                         </plugin>
140                         <plugin>
141                                 <artifactId>maven-dependency-plugin</artifactId>
142                                 <executions>
143                                         <execution>
144                                                 <id>copy</id>
145                                                 <phase>package</phase>
146                                                 <goals>
147                                                         <goal>copy</goal>
148                                                 </goals>
149                                                 <configuration>
150                                                         <outputDirectory>target</outputDirectory>
151                                                         <encoding>UTF-8</encoding>
152                                                         <artifactItems>
153                                                                 <artifactItem>
154                                                                         <groupId>org.onap.dmaap.messagerouter.mirroragent</groupId>
155                                                                         <artifactId>dmaapMMAgent</artifactId>
156                                                                         <version>1.1.2</version>
157                                                                         <destFileName>dmaapMMAgent.jar</destFileName>
158                                                                 </artifactItem>
159                                                         </artifactItems>
160                                                 </configuration>
161                                         </execution>
162                                 </executions>
163                         </plugin>
164                         <plugin>
165                                 <artifactId>maven-resources-plugin</artifactId>
166                                         <version>2.7</version>
167                                         <executions>
168                                                 <execution>
169                                                         <id>copy-jar</id>
170                                                         <phase>install</phase>
171                                                         <goals>
172                                                                 <goal>copy-resources</goal>
173                                                         </goals>
174                                                         <configuration>
175                                                                 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
176                                                                 <resources>
177                                                                         <resource>
178                                                                                 <directory>${basedir}/target</directory>
179                                                                                 <includes>
180                                                                                         <include>dmaapMMAgent.jar</include>
181                                                                                         <include>kafka11aaf-jar-with-dependencies.jar</include>
182                                                                                 </includes>
183                                                                         </resource>
184                                                                 </resources>
185                                                         </configuration>
186                                                 </execution>
187                                   </executions>
188                         </plugin>
189                         <plugin>
190                                 <groupId>org.apache.maven.plugins</groupId>
191                                 <artifactId>maven-assembly-plugin</artifactId>
192                                 <version>2.4.1</version>
193                                 <configuration>
194                                         <!-- get all project dependencies -->
195                                         <descriptorRefs>
196                                                 <descriptorRef>jar-with-dependencies</descriptorRef>
197                                         </descriptorRefs>
198                                         <!-- MainClass in mainfest make a executable jar -->
199                                         <finalName>kafka11aaf</finalName>
200                                 </configuration>
201                                 <executions>
202                                         <execution>
203                                                 <id>make-assembly</id>
204                                                 <!-- bind to the packaging phase -->
205                                                 <phase>package</phase>
206                                                 <goals>
207                                                         <goal>single</goal>
208                                                 </goals>
209                                         </execution>
210                                 </executions>
211                         </plugin>
212
213                 </plugins>
214         </build>
215
216         <properties>
217                 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
218                 <timestamp>${maven.build.timestamp}</timestamp>
219                 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
220                 <sitePath>/content/sites/site/org/onap/dmaap/kafka0111/${project.artifactId}/${project.version}</sitePath>
221                 <skip.docker.build>true</skip.docker.build>
222                 <skip.docker.push>true</skip.docker.push>
223                 <nexusproxy>https://nexus.onap.org</nexusproxy>
224                 <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
225                 <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
226         </properties>
227
228         <!-- Distribution management -->
229         <distributionManagement>
230                 <site>
231                         <id>ecomp-site</id>
232                         <url>dav:${nexusproxy}${sitePath}</url>
233                 </site>
234         </distributionManagement>
235
236         <dependencies>
237                 <dependency>
238                         <groupId>org.onap.aaf.authz</groupId>
239                         <artifactId>aaf-cadi-aaf</artifactId>
240                         <version>2.1.2</version>
241                 </dependency>
242                 <dependency>
243                         <groupId>org.slf4j</groupId>
244                         <artifactId>slf4j-api</artifactId>
245                         <version>1.7.2</version>
246                 </dependency>
247                 <dependency>
248                         <groupId>org.slf4j</groupId>
249                         <artifactId>slf4j-simple</artifactId>
250                         <version>1.7.2</version>
251                         <scope>runtime</scope>
252                 </dependency>
253                 <dependency>
254                         <groupId>org.apache.kafka</groupId>
255                         <artifactId>kafka_2.11</artifactId>
256                         <version>2.3.0</version>
257                         <scope>provided</scope>
258                 </dependency>
259
260                 <dependency>
261                         <groupId>org.powermock</groupId>
262                         <artifactId>powermock-api-mockito</artifactId>
263                         <version>1.6.4</version>
264                         <scope>test</scope>
265                 </dependency>
266
267                 <dependency>
268                         <groupId>org.powermock</groupId>
269                         <artifactId>powermock-module-junit4</artifactId>
270                         <version>1.6.4</version>
271                         <scope>test</scope>
272                 </dependency>
273
274                 <dependency>
275                         <groupId>org.powermock</groupId>
276                         <artifactId>powermock-module-junit4-rule</artifactId>
277                         <version>1.6.4</version>
278                         <scope>test</scope>
279                 </dependency>
280                 <dependency>
281                         <groupId>org.mockito</groupId>
282                         <artifactId>mockito-core</artifactId>
283                         <version>1.10.19</version>
284                         <scope>test</scope>
285                 </dependency>
286         </dependencies>
287
288         <profiles>
289                 <profile>
290                         <id>docker</id>
291                         <properties>
292                                 <skip.docker.build>false</skip.docker.build>
293                                 <skip.docker.tag>false</skip.docker.tag>
294                                 <skip.docker.push>false</skip.docker.push>
295                         </properties>
296                         <build>
297                                 <plugins>
298                                         <plugin>
299                                                 <groupId>org.codehaus.groovy.maven</groupId>
300                                                 <artifactId>gmaven-plugin</artifactId>
301                                                 <executions>
302                                                         <execution>
303                                                                 <phase>validate</phase>
304                                                                 <goals>
305                                                                         <goal>execute</goal>
306                                                                 </goals>
307                                                                 <configuration>
308                                                                         <properties>
309                                                                                 <ver>${project.version}</ver>
310                                                                                 <timestamp>${maven.build.timestamp}</timestamp>
311                                                                         </properties>
312                                                                         <source>
313                                                                                 println project.properties['ver'];
314                                                                                 if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
315                                                                                 project.properties['dockertag1']=project.properties['ver'] +
316                                                                                 "-latest";
317                                                                                 project.properties['dockertag2']=project.properties['ver'] +
318                                                                                 "-" + project.properties['timestamp'];
319                                                                                 } else {
320                                                                                 project.properties['dockertag1']=project.properties['ver'] +
321                                                                                 "-STAGING-latest";
322                                                                                 project.properties['dockertag2']=project.properties['ver'] +
323                                                                                 "-STAGING-" + project.properties['timestamp'];
324                                                                                 }
325                                                                                 println 'docker tag 1: ' + project.properties['dockertag1'];
326                                                                                 println 'docker tag 2: ' + project.properties['dockertag2'];
327                                                                         </source>
328                                                                 </configuration>
329                                                         </execution>
330                                                 </executions>
331                                         </plugin>
332                                         <!-- build docker image -->
333                                         <plugin>
334                                                 <groupId>io.fabric8</groupId>
335                                                 <artifactId>docker-maven-plugin</artifactId>
336                                                 <version>0.28.0</version>
337                                                 <configuration>
338                                                         <verbose>${docker.verbose}</verbose>
339                                                         <apiVersion>${docker.apiVersion}</apiVersion>
340                                                         <pullRegistry>${docker.pull.registry}</pullRegistry>
341                                                         <pushRegistry>${docker.push.registry}</pushRegistry>
342                                                         <images>
343                                                                 <image>
344                                                                         <name>onap/dmaap/kafka111</name>
345                                                                         <build>
346                                                                                 <cleanup>try</cleanup>
347                                                                                 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
348                                                                                 <dockerFile>Dockerfile</dockerFile>
349                                                                                 <tags>
350                                                                                         <tag>${dockertag1}</tag>
351                                                                                         <tag>${dockertag2}</tag>
352                                                                                 </tags>
353                                                                         </build>
354                                                                 </image>
355                                                         </images>
356                                                 </configuration>
357                                                 <executions>
358                                                         <execution>
359                                                                 <id>generate-images</id>
360                                                                 <phase>install</phase>
361                                                                 <goals>
362                                                                         <goal>build</goal>
363                                                                 </goals>
364                                                         </execution>
365                                                         <execution>
366                                                                 <id>push-images</id>
367                                                                 <phase>deploy</phase>
368                                                                 <goals>
369                                                                         <goal>push</goal>
370                                                                 </goals>
371                                                         </execution>
372                                               </executions>
373                                         </plugin>
374                                 </plugins>
375                         </build>
376                 </profile>
377
378         </profiles>
379
380 </project>