[DMAAP-KAFKA] Kafka Upgrade
[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"
13   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
14   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
15   <modelVersion>4.0.0</modelVersion>
16   <parent>
17     <groupId>org.onap.oparent</groupId>
18     <artifactId>oparent</artifactId>
19     <version>3.2.0</version>
20   </parent>
21
22   <groupId>org.onap.dmaap.kafka</groupId>
23   <artifactId>kafka11aaf</artifactId>
24   <version>1.1.0-SNAPSHOT</version>
25   <name>dmaap-kafka</name>
26
27   <properties>
28     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
29     <timestamp>${maven.build.timestamp}</timestamp>
30     <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
31     <sitePath>
32       /content/sites/site/org/onap/dmaap/kafka0111/${project.artifactId}/${project.version}
33     </sitePath>
34     <skip.docker.build>true</skip.docker.build>
35     <skip.docker.push>true</skip.docker.push>
36     <nexusproxy>https://nexus.onap.org</nexusproxy>
37     <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
38     <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
39     <sonar.language>java</sonar.language>
40     <sonar.skip>false</sonar.skip>
41     <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports
42     </sonar.surefire.reportsPath>
43     <sonar.coverage.jacoco.xmlReportPaths>
44       ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml
45     </sonar.coverage.jacoco.xmlReportPaths>
46     <sonar.projectVersion>${project.version}</sonar.projectVersion>
47     <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**
48     </sonar.exclusions>
49     <powermock.version>1.6.4</powermock.version>
50   </properties>
51
52   <distributionManagement>
53     <site>
54       <id>ecomp-site</id>
55       <url>dav:${nexusproxy}${sitePath}</url>
56     </site>
57   </distributionManagement>
58
59   <build>
60     <!-- Copy files to docker-stage to be included in image -->
61     <resources>
62       <resource>
63         <targetPath>${basedir}/target/docker-stage</targetPath>
64         <directory>${basedir}/src/main/docker</directory>
65       </resource>
66       <resource>
67         <directory>${basedir}/src/main/resources</directory>
68       </resource>
69     </resources>
70     <plugins>
71       <plugin>
72         <groupId>org.jacoco</groupId>
73         <artifactId>jacoco-maven-plugin</artifactId>
74       </plugin>
75       <plugin>
76         <groupId>org.apache.maven.plugins</groupId>
77         <artifactId>maven-surefire-plugin</artifactId>
78         <configuration>
79           <excludes>
80           </excludes>
81           <argLine>
82           </argLine>
83           <skipTests>false</skipTests>
84         </configuration>
85       </plugin>
86       <plugin>
87         <groupId>org.apache.maven.plugins</groupId>
88         <artifactId>maven-failsafe-plugin</artifactId>
89         <configuration>
90           <argLine>
91             --illegal-access=permit
92           </argLine>
93         </configuration>
94       </plugin>
95       <plugin>
96         <artifactId>maven-dependency-plugin</artifactId>
97         <executions>
98           <execution>
99             <id>copy</id>
100             <phase>package</phase>
101             <goals>
102               <goal>copy</goal>
103             </goals>
104             <configuration>
105               <outputDirectory>target</outputDirectory>
106               <artifactItems>
107                 <artifactItem>
108                   <groupId>org.onap.dmaap.messagerouter.mirroragent</groupId>
109                   <artifactId>dmaapMMAgent</artifactId>
110                   <version>1.1.2</version>
111                   <destFileName>dmaapMMAgent.jar</destFileName>
112                 </artifactItem>
113               </artifactItems>
114             </configuration>
115           </execution>
116         </executions>
117       </plugin>
118       <plugin>
119         <artifactId>maven-resources-plugin</artifactId>
120         <version>2.7</version>
121         <executions>
122           <execution>
123             <id>copy-jar</id>
124             <phase>install</phase>
125             <goals>
126               <goal>copy-resources</goal>
127             </goals>
128             <configuration>
129               <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
130               <resources>
131                 <resource>
132                   <directory>${basedir}/target</directory>
133                   <includes>
134                     <include>dmaapMMAgent.jar</include>
135                     <include>kafka11aaf.jar</include>
136                   </includes>
137                 </resource>
138               </resources>
139             </configuration>
140           </execution>
141         </executions>
142       </plugin>
143       <plugin>
144         <groupId>org.apache.maven.plugins</groupId>
145         <artifactId>maven-shade-plugin</artifactId>
146         <version>3.2.4</version>
147         <executions>
148           <execution>
149             <phase>package</phase>
150             <goals>
151               <goal>shade</goal>
152             </goals>
153             <configuration>
154               <finalName>${project.artifactId}</finalName>
155               <artifactSet>
156                 <excludes>
157                 </excludes>
158               </artifactSet>
159               <filters>
160                 <filter>
161                   <artifact>*:*</artifact>
162                   <excludes>
163                     <exclude>META-INF/*.SF</exclude>
164                     <exclude>META-INF/*.DSA</exclude>
165                     <exclude>META-INF/*.RSA</exclude>
166                   </excludes>
167                 </filter>
168               </filters>
169             </configuration>
170           </execution>
171         </executions>
172       </plugin>
173       <plugin>
174         <artifactId>maven-checkstyle-plugin</artifactId>
175         <executions>
176           <execution>
177             <id>onap-java-style</id>
178             <configuration>
179               <consoleOutput>false</consoleOutput>
180             </configuration>
181           </execution>
182         </executions>
183       </plugin>
184     </plugins>
185   </build>
186
187   <dependencies>
188     <dependency>
189       <groupId>org.onap.aaf.authz</groupId>
190       <artifactId>aaf-cadi-aaf</artifactId>
191       <version>2.7.4</version>
192     </dependency>
193     <dependency>
194       <groupId>org.apache.kafka</groupId>
195       <artifactId>kafka_2.13</artifactId>
196       <version>2.8.0</version>
197     </dependency>
198     <dependency>
199       <groupId>org.powermock</groupId>
200       <artifactId>powermock-api-mockito</artifactId>
201       <version>${powermock.version}</version>
202       <scope>test</scope>
203     </dependency>
204     <dependency>
205       <groupId>org.powermock</groupId>
206       <artifactId>powermock-module-junit4</artifactId>
207       <version>${powermock.version}</version>
208       <scope>test</scope>
209     </dependency>
210     <dependency>
211       <groupId>org.powermock</groupId>
212       <artifactId>powermock-module-junit4-rule</artifactId>
213       <version>${powermock.version}</version>
214       <scope>test</scope>
215     </dependency>
216     <dependency>
217       <groupId>org.mockito</groupId>
218       <artifactId>mockito-core</artifactId>
219       <version>1.10.19</version>
220       <scope>test</scope>
221     </dependency>
222   </dependencies>
223
224   <profiles>
225     <profile>
226       <id>docker</id>
227       <properties>
228         <skip.docker.build>false</skip.docker.build>
229         <skip.docker.tag>false</skip.docker.tag>
230         <skip.docker.push>false</skip.docker.push>
231       </properties>
232       <build>
233         <plugins>
234           <plugin>
235             <groupId>org.codehaus.groovy.maven</groupId>
236             <artifactId>gmaven-plugin</artifactId>
237             <version>1.0</version>
238             <executions>
239               <execution>
240                 <phase>validate</phase>
241                 <goals>
242                   <goal>execute</goal>
243                 </goals>
244                 <configuration>
245                   <properties>
246                     <ver>${project.version}</ver>
247                     <timestamp>${maven.build.timestamp}</timestamp>
248                   </properties>
249                   <source>
250                     println project.properties['ver'];
251                     if (project.properties['ver'].endsWith("-SNAPSHOT")) {
252                       project.properties['dockertag1'] = project.properties['ver'] +
253                         "-latest";
254                       project.properties['dockertag2'] = project.properties['ver'] +
255                         "-" + project.properties['timestamp'];
256                     } else {
257                       project.properties['dockertag1'] = project.properties['ver'] +
258                         "-STAGING-latest";
259                       project.properties['dockertag2'] = project.properties['ver'] +
260                         "-STAGING-" + project.properties['timestamp'];
261                     }
262                     println 'docker tag 1: ' + project.properties['dockertag1'];
263                     println 'docker tag 2: ' + project.properties['dockertag2'];
264                   </source>
265                 </configuration>
266               </execution>
267             </executions>
268           </plugin>
269           <plugin>
270             <groupId>io.fabric8</groupId>
271             <artifactId>docker-maven-plugin</artifactId>
272             <version>0.28.0</version>
273             <configuration>
274               <pullRegistry>${docker.pull.registry}</pullRegistry>
275               <pushRegistry>${docker.push.registry}</pushRegistry>
276               <images>
277                 <image>
278                   <name>onap/dmaap/kafka111</name>
279                   <build>
280                     <cleanup>try</cleanup>
281                     <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
282                     <dockerFile>Dockerfile</dockerFile>
283                     <tags>
284                       <tag>${dockertag1}</tag>
285                       <tag>${dockertag2}</tag>
286                     </tags>
287                   </build>
288                 </image>
289               </images>
290             </configuration>
291             <executions>
292               <execution>
293                 <id>generate-images</id>
294                 <phase>install</phase>
295                 <goals>
296                   <goal>build</goal>
297                 </goals>
298               </execution>
299               <execution>
300                 <id>push-images</id>
301                 <phase>deploy</phase>
302                 <goals>
303                   <goal>push</goal>
304                 </goals>
305               </execution>
306             </executions>
307           </plugin>
308         </plugins>
309       </build>
310     </profile>
311   </profiles>
312 </project>