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