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