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