small multi-platform 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>1.2.1</version>
20         </parent>
21
22         <groupId>org.onap.dmaap.kafka</groupId>
23         <artifactId>kafka11aaf</artifactId>
24         <version>0.0.4-SNAPSHOT</version>
25         <name>dmaap-kafka11aaf</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                     <includes>
48                         <include>*</include>
49                     </includes>
50             </resource>
51         </resources>
52                 <plugins>
53                         <plugin>
54                                 <groupId>org.apache.maven.plugins</groupId>
55                                 <artifactId>maven-surefire-plugin</artifactId>
56                                 <version>2.12.4</version>
57                                 <configuration>
58                                         <excludes>
59                                                 <!-- exclude until junits updated <exclude>**/DME2*.java</exclude> -->
60                                         </excludes>
61                                         <!-- <skipTests>true</skipTests> -->
62                                 </configuration>
63                         </plugin>
64                         <plugin>
65                                 <groupId>org.codehaus.mojo</groupId>
66                                 <artifactId>cobertura-maven-plugin</artifactId>
67                                 <version>2.7</version>
68                                 <configuration>
69                                         <formats>
70                                                 <format>html</format>
71                                                 <format>xml</format>
72                                         </formats>
73                                 </configuration>
74                         </plugin>
75                         <plugin>
76                                 <groupId>org.apache.maven.plugins</groupId>
77                                 <artifactId>maven-site-plugin</artifactId>
78                                 <version>3.6</version>
79                                 <dependencies>
80                                         <dependency>
81                                                 <groupId>org.apache.maven.wagon</groupId>
82                                                 <artifactId>wagon-webdav-jackrabbit</artifactId>
83                                                 <version>2.10</version>
84                                         </dependency>
85                                 </dependencies>
86                         </plugin>
87
88                         <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> 
89                                 <version>3.0.2</version> </plugin> -->
90
91                         <plugin>
92                                 <groupId>org.apache.maven.plugins</groupId>
93                                 <artifactId>maven-source-plugin</artifactId>
94                                 <version>3.0.0</version>
95                                 <executions>
96                                         <execution>
97                                                 <id>attach-sources</id>
98                                                 <goals>
99                                                         <goal>jar-no-fork</goal>
100                                                 </goals>
101                                         </execution>
102                                 </executions>
103                         </plugin>
104                         <plugin>
105                                 <groupId>org.apache.maven.plugins</groupId>
106                                 <artifactId>maven-release-plugin</artifactId>
107                                 <version>2.5.3</version>
108                                 <configuration>
109                                         <autoVersionSubmodules>true</autoVersionSubmodules>
110                                         <checkModificationExcludes>
111                                         </checkModificationExcludes>
112                                 </configuration>
113                                 <dependencies>
114                                         <dependency>
115                                                 <groupId>org.apache.maven.scm</groupId>
116                                                 <artifactId>maven-scm-provider-gitexe</artifactId>
117                                                 <version>1.9.4</version>
118                                         </dependency>
119                                 </dependencies>
120                         </plugin>
121
122                         <plugin>
123                                 <groupId>org.sonatype.plugins</groupId>
124                                 <artifactId>nexus-staging-maven-plugin</artifactId>
125                                 <extensions>false</extensions>
126                                 <executions>
127                                         <execution>
128                                                 <id>injected-nexus-deploy</id>
129                                                 <phase>none</phase>
130                                         </execution>
131                                 </executions>
132                         </plugin>
133                         <plugin>
134                                 <artifactId>maven-deploy-plugin</artifactId>
135                                 <version>2.8</version>
136                                 <executions>
137                                         <execution>
138                                                 <id>default-deploy</id>
139                                                 <phase>none</phase>
140                                                 <configuration>
141                                                         <skip />
142                                                 </configuration>
143                                         </execution>
144                                 </executions>
145                                 <configuration>
146                                         <skip />
147                                 </configuration>
148                         </plugin>
149                         <plugin>
150                                 <artifactId>maven-dependency-plugin</artifactId>
151                                 <executions>
152                                         <execution>
153                                                 <id>copy</id>
154                                                 <phase>package</phase>
155                                                 <goals>
156                                                         <goal>copy</goal>
157                                                 </goals>
158                                                 <configuration>
159                                                         <outputDirectory>target</outputDirectory>
160                                                         <encoding>UTF-8</encoding>
161                                                         <artifactItems>
162                                                                 <artifactItem>
163                                                                         <groupId>org.onap.dmaap.messagerouter.mirroragent</groupId>
164                                                                         <artifactId>dmaapMMAgent</artifactId>
165                                                                         <version>1.1.1-SNAPSHOT</version>
166                                                                         <destFileName>dmaapMMAgent.jar</destFileName>
167                                                                 </artifactItem>
168                                                         </artifactItems>
169                                                 </configuration>
170                                         </execution>
171                                 </executions>
172                         </plugin>
173                         <plugin>
174                                 <groupId>org.apache.maven.plugins</groupId>
175                                 <artifactId>maven-enforcer-plugin</artifactId>
176                                 <executions>
177                                         <execution>
178                                                 <id>enforce-no-snapshots</id>
179                                                 <goals>
180                                                         <goal>enforce</goal>
181                                                 </goals>
182                                                 <configuration>
183                                                         <rules>
184                                                                 <requireReleaseDeps>
185                                                                         <message>No Snapshots Allowed!</message>
186                                                                         <excludes>
187                                                                                 <exclude>org.onap.dmaap.messagerouter.mirroragent:dmaapMMAgent</exclude>
188                                                                         </excludes>
189                                                                 </requireReleaseDeps>
190                                                         </rules>
191                                                         <fail>true</fail>
192                                                 </configuration>
193                                         </execution>
194                                 </executions>
195                         </plugin>
196               <!-- Copy jar to docker-stage to be included in image -->
197               <plugin>
198                   <artifactId>maven-resources-plugin</artifactId>
199                   <version>2.7</version>
200                   <executions>
201                      <execution>
202                           <id>copy-jar</id>
203                           <phase>install</phase>
204                           <goals>
205                               <goal>copy-resources</goal>
206                           </goals>
207                           <configuration>
208                               <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
209                               <resources>
210                                   <resource>
211                                       <directory>${basedir}/target</directory>
212                                       <includes>
213                                           <include>dmaapMMAgent.jar</include>
214                                           <include>kafka11aaf-jar-with-dependencies.jar</include>
215                                       </includes>
216                                   </resource>
217                               </resources>
218                           </configuration>
219                       </execution>
220                   </executions>
221               </plugin>
222                         <plugin>
223                                 <groupId>org.apache.maven.plugins</groupId>
224                                 <artifactId>maven-assembly-plugin</artifactId>
225                                 <version>2.4.1</version>
226                                 <configuration>
227                                         <!-- get all project dependencies -->
228                                         <descriptorRefs>
229                                                 <descriptorRef>jar-with-dependencies</descriptorRef>
230                                         </descriptorRefs>
231                                         <!-- MainClass in mainfest make a executable jar -->
232                                         <finalName>kafka11aaf</finalName>
233                                 </configuration>
234                                 <executions>
235                                         <execution>
236                                                 <id>make-assembly</id>
237                                                 <!-- bind to the packaging phase -->
238                                                 <phase>package</phase>
239                                                 <goals>
240                                                         <goal>single</goal>
241                                                 </goals>
242                                         </execution>
243                                 </executions>
244                         </plugin>
245
246                 </plugins>
247         </build>
248
249         <properties>
250                 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
251                 <timestamp>${maven.build.timestamp}</timestamp>
252         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
253                 <sitePath>/content/sites/site/org/onap/dmaap/kafka0111/${project.artifactId}/${project.version}</sitePath>
254                 <skip.docker.build>true</skip.docker.build>
255                 <skip.docker.push>true</skip.docker.push>
256                 <nexusproxy>https://nexus.onap.org</nexusproxy>
257                 <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
258                 <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
259         </properties>
260
261         <!-- Distribution management -->
262         <distributionManagement>
263                 <site>
264                         <id>ecomp-site</id>
265                         <url>dav:${nexusproxy}${sitePath}</url>
266                 </site>
267         </distributionManagement>
268
269         <dependencies>
270                 <dependency>
271                         <groupId>org.onap.aaf.authz</groupId>
272                         <artifactId>aaf-cadi-aaf</artifactId>
273                         <version>2.1.2</version>
274                 </dependency>
275                 <dependency>
276                         <groupId>org.slf4j</groupId>
277                         <artifactId>slf4j-api</artifactId>
278                         <version>1.7.2</version>
279                 </dependency>
280                 <dependency>
281                         <groupId>org.slf4j</groupId>
282                         <artifactId>slf4j-simple</artifactId>
283                         <version>1.7.2</version>
284                         <scope>runtime</scope>
285                 </dependency>
286                 <dependency>
287                         <groupId>org.apache.kafka</groupId>
288                         <artifactId>kafka_2.11</artifactId>
289                         <version>0.11.0.3</version>
290                 </dependency>
291                 <dependency>
292                         <groupId>org.powermock</groupId>
293                         <artifactId>powermock-api-mockito</artifactId>
294                         <version>1.6.4</version>
295                         <scope>test</scope>
296                 </dependency>
297
298                 <dependency>
299                         <groupId>org.powermock</groupId>
300                         <artifactId>powermock-module-junit4</artifactId>
301                         <version>1.6.4</version>
302                         <scope>test</scope>
303                 </dependency>
304
305                 <dependency>
306                         <groupId>org.powermock</groupId>
307                         <artifactId>powermock-module-junit4-rule</artifactId>
308                         <version>1.6.4</version>
309                         <scope>test</scope>
310                 </dependency>
311                 <dependency>
312                         <groupId>org.mockito</groupId>
313                         <artifactId>mockito-core</artifactId>
314                         <version>1.10.19</version>
315                         <scope>test</scope>
316                 </dependency>
317         </dependencies>
318
319         <profiles>
320                 <profile>
321                         <id>docker</id>
322                         <properties>
323                                 <skip.docker.build>false</skip.docker.build>
324                                 <skip.docker.tag>false</skip.docker.tag>
325                                 <skip.docker.push>false</skip.docker.push>
326                         </properties>
327                         <build>
328                 <plugins>
329                     <plugin>
330                         <groupId>org.codehaus.groovy.maven</groupId>
331                         <artifactId>gmaven-plugin</artifactId>
332                         <executions>
333                             <execution>
334                                 <phase>validate</phase>
335                                 <goals>
336                                     <goal>execute</goal>
337                                 </goals>
338                                 <configuration>
339                                     <properties>
340                                         <ver>${project.version}</ver>
341                                         <timestamp>${maven.build.timestamp}</timestamp>
342                                     </properties>
343                                     <source>
344                                         println project.properties['ver'];
345                                         if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
346                                         project.properties['dockertag1']=project.properties['ver'] + "-latest";
347                                         project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
348                                         } else {
349                                         project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest";
350                                         project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
351                                         }
352                                         println 'docker tag 1: ' + project.properties['dockertag1'];
353                                         println 'docker tag 2: ' + project.properties['dockertag2'];
354                                     </source>
355                                 </configuration>
356                             </execution>
357                         </executions>
358                     </plugin>
359                     <!-- build docker image -->
360                     <plugin>
361                       <groupId>io.fabric8</groupId>
362                       <artifactId>docker-maven-plugin</artifactId>
363                       <version>0.28.0</version>  
364                       <configuration>
365                           <verbose>${docker.verbose}</verbose>
366                           <apiVersion>${docker.apiVersion}</apiVersion>
367                           <pullRegistry>${docker.pull.registry}</pullRegistry>
368                           <pushRegistry>${docker.push.registry}</pushRegistry>
369                           <images>
370                               <image>                            
371                                   <name>onap/dmaap/kafka01101</name>
372                                   <build>
373                                       <cleanup>try</cleanup>
374                                      <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
375                                      <dockerFile>Dockerfile</dockerFile>
376                                       <tags>
377                                           <tag>${dockertag1}</tag>
378                                           <tag>${dockertag2}</tag>
379                                       </tags>
380                                   </build>
381                               </image>
382                           </images>
383                       </configuration>
384                       <executions>
385                           <execution>
386                               <id>generate-images</id>
387                               <phase>install</phase>
388                               <goals>
389                                   <goal>build</goal>
390                               </goals>
391                           </execution>
392                           <execution>
393                               <id>push-images</id>
394                               <phase>deploy</phase>
395                               <goals>
396                                   <goal>push</goal>
397                               </goals>
398                           </execution>
399                       </executions>
400                    </plugin>
401                 </plugins>
402             </build>
403                 </profile>
404
405         </profiles>
406
407 </project>