DMAAP - Kafka issue fix
[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     <maven.compiler.source>11</maven.compiler.source>
51     <maven.compiler.target>11</maven.compiler.target>
52   </properties>
53
54   <distributionManagement>
55     <site>
56       <id>ecomp-site</id>
57       <url>dav:${nexusproxy}${sitePath}</url>
58     </site>
59   </distributionManagement>
60
61   <build>
62     <!-- Copy files to docker-stage to be included in image -->
63     <resources>
64       <resource>
65         <targetPath>${basedir}/target/docker-stage</targetPath>
66         <directory>${basedir}/src/main/docker</directory>
67       </resource>
68       <resource>
69         <directory>${basedir}/src/main/resources</directory>
70       </resource>
71     </resources>
72     <plugins>
73       <plugin>
74         <groupId>org.apache.maven.plugins</groupId>
75         <artifactId>maven-compiler-plugin</artifactId>
76         <configuration>
77           <source>${maven.compiler.source}</source>
78           <target>${maven.compiler.target}</target>
79         </configuration>
80       </plugin>
81       <plugin>
82         <groupId>org.jacoco</groupId>
83         <artifactId>jacoco-maven-plugin</artifactId>
84       </plugin>
85       <plugin>
86         <groupId>org.apache.maven.plugins</groupId>
87         <artifactId>maven-surefire-plugin</artifactId>
88         <configuration>
89           <excludes>
90           </excludes>
91           <argLine>
92           </argLine>
93           <skipTests>false</skipTests>
94         </configuration>
95       </plugin>
96       <plugin>
97         <groupId>org.apache.maven.plugins</groupId>
98         <artifactId>maven-failsafe-plugin</artifactId>
99         <configuration>
100           <argLine>
101             --illegal-access=permit
102           </argLine>
103         </configuration>
104       </plugin>
105       <plugin>
106         <artifactId>maven-dependency-plugin</artifactId>
107         <executions>
108           <execution>
109             <id>copy</id>
110             <phase>package</phase>
111             <goals>
112               <goal>copy</goal>
113             </goals>
114             <configuration>
115               <outputDirectory>target</outputDirectory>
116               <artifactItems>
117                 <artifactItem>
118                   <groupId>org.onap.dmaap.messagerouter.mirroragent</groupId>
119                   <artifactId>dmaapMMAgent</artifactId>
120                   <version>1.1.2</version>
121                   <destFileName>dmaapMMAgent.jar</destFileName>
122                 </artifactItem>
123               </artifactItems>
124             </configuration>
125           </execution>
126         </executions>
127       </plugin>
128       <plugin>
129         <artifactId>maven-resources-plugin</artifactId>
130         <version>2.7</version>
131         <executions>
132           <execution>
133             <id>copy-jar</id>
134             <phase>install</phase>
135             <goals>
136               <goal>copy-resources</goal>
137             </goals>
138             <configuration>
139               <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
140               <resources>
141                 <resource>
142                   <directory>${basedir}/target</directory>
143                   <includes>
144                     <include>dmaapMMAgent.jar</include>
145                     <include>kafka11aaf.jar</include>
146                   </includes>
147                 </resource>
148               </resources>
149             </configuration>
150           </execution>
151         </executions>
152       </plugin>
153       <plugin>
154         <groupId>org.apache.maven.plugins</groupId>
155         <artifactId>maven-shade-plugin</artifactId>
156         <version>3.2.4</version>
157         <executions>
158           <execution>
159             <phase>package</phase>
160             <goals>
161               <goal>shade</goal>
162             </goals>
163             <configuration>
164               <finalName>${project.artifactId}</finalName>
165               <artifactSet>
166                 <excludes>
167                 </excludes>
168               </artifactSet>
169               <filters>
170                 <filter>
171                   <artifact>*:*</artifact>
172                   <excludes>
173                     <exclude>META-INF/*.SF</exclude>
174                     <exclude>META-INF/*.DSA</exclude>
175                     <exclude>META-INF/*.RSA</exclude>
176                   </excludes>
177                 </filter>
178               </filters>
179             </configuration>
180           </execution>
181         </executions>
182       </plugin>
183       <plugin>
184         <artifactId>maven-checkstyle-plugin</artifactId>
185         <executions>
186           <execution>
187             <id>onap-java-style</id>
188             <configuration>
189               <consoleOutput>false</consoleOutput>
190             </configuration>
191           </execution>
192         </executions>
193       </plugin>
194       <plugin>
195         <artifactId>maven-deploy-plugin</artifactId>
196         <version>3.0.0-M1</version>
197         <configuration>
198           <skip>true</skip>
199         </configuration>
200       </plugin>
201     </plugins>
202   </build>
203
204   <dependencies>
205     <dependency>
206       <groupId>org.onap.aaf.authz</groupId>
207       <artifactId>aaf-cadi-aaf</artifactId>
208       <version>2.7.4</version>
209     </dependency>
210     <dependency>
211       <groupId>org.apache.kafka</groupId>
212       <artifactId>kafka_2.13</artifactId>
213       <version>2.8.0</version>
214     </dependency>
215     <dependency>
216       <groupId>org.powermock</groupId>
217       <artifactId>powermock-api-mockito</artifactId>
218       <version>${powermock.version}</version>
219       <scope>test</scope>
220     </dependency>
221     <dependency>
222       <groupId>org.powermock</groupId>
223       <artifactId>powermock-module-junit4</artifactId>
224       <version>${powermock.version}</version>
225       <scope>test</scope>
226     </dependency>
227     <dependency>
228       <groupId>org.powermock</groupId>
229       <artifactId>powermock-module-junit4-rule</artifactId>
230       <version>${powermock.version}</version>
231       <scope>test</scope>
232     </dependency>
233     <dependency>
234       <groupId>org.mockito</groupId>
235       <artifactId>mockito-core</artifactId>
236       <version>1.10.19</version>
237       <scope>test</scope>
238     </dependency>
239   </dependencies>
240
241   <profiles>
242     <profile>
243       <id>docker</id>
244       <properties>
245         <skip.docker.build>false</skip.docker.build>
246         <skip.docker.tag>false</skip.docker.tag>
247         <skip.docker.push>false</skip.docker.push>
248       </properties>
249       <build>
250         <plugins>
251           <plugin>
252             <groupId>org.codehaus.groovy.maven</groupId>
253             <artifactId>gmaven-plugin</artifactId>
254             <version>1.0</version>
255             <executions>
256               <execution>
257                 <phase>validate</phase>
258                 <goals>
259                   <goal>execute</goal>
260                 </goals>
261                 <configuration>
262                   <properties>
263                     <ver>${project.version}</ver>
264                     <timestamp>${maven.build.timestamp}</timestamp>
265                   </properties>
266                   <source>
267                     println project.properties['ver'];
268                     if (project.properties['ver'].endsWith("-SNAPSHOT")) {
269                       project.properties['dockertag1'] = project.properties['ver'] +
270                         "-latest";
271                       project.properties['dockertag2'] = project.properties['ver'] +
272                         "-" + project.properties['timestamp'];
273                     } else {
274                       project.properties['dockertag1'] = project.properties['ver'] +
275                         "-STAGING-latest";
276                       project.properties['dockertag2'] = project.properties['ver'] +
277                         "-STAGING-" + project.properties['timestamp'];
278                     }
279                     println 'docker tag 1: ' + project.properties['dockertag1'];
280                     println 'docker tag 2: ' + project.properties['dockertag2'];
281                   </source>
282                 </configuration>
283               </execution>
284             </executions>
285           </plugin>
286           <plugin>
287             <groupId>io.fabric8</groupId>
288             <artifactId>docker-maven-plugin</artifactId>
289             <version>0.28.0</version>
290             <configuration>
291               <pullRegistry>${docker.pull.registry}</pullRegistry>
292               <pushRegistry>${docker.push.registry}</pushRegistry>
293               <images>
294                 <image>
295                   <name>onap/dmaap/kafka111</name>
296                   <build>
297                     <cleanup>try</cleanup>
298                     <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
299                     <dockerFile>Dockerfile</dockerFile>
300                     <tags>
301                       <tag>${dockertag1}</tag>
302                       <tag>${dockertag2}</tag>
303                     </tags>
304                   </build>
305                 </image>
306               </images>
307             </configuration>
308             <executions>
309               <execution>
310                 <id>generate-images</id>
311                 <phase>install</phase>
312                 <goals>
313                   <goal>build</goal>
314                 </goals>
315               </execution>
316               <execution>
317                 <id>push-images</id>
318                 <phase>deploy</phase>
319                 <goals>
320                   <goal>push</goal>
321                 </goals>
322               </execution>
323             </executions>
324           </plugin>
325         </plugins>
326       </build>
327     </profile>
328   </profiles>
329 </project>