ded2cc21d7a0cf7bb464a94a4bae2b44de643927
[dmaap/buscontroller.git] / dmaap-bc / pom.xml
1 <?xml version="1.0"?>
2 <!--
3   ============LICENSE_START==========================================
4   org.onap.dmaap
5   ===================================================================
6   Copyright © 2018 AT&T Intellectual Property. All rights reserved.
7   ===================================================================
8   Licensed under the Apache License, Version 2.0 (the "License");
9   you may not use this file except in compliance with the License.
10   You may obtain a copy of the License at
11
12          http://www.apache.org/licenses/LICENSE-2.0
13
14   Unless required by applicable law or agreed to in writing, software
15   distributed under the License is distributed on an "AS IS" BASIS,
16   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   See the License for the specific language governing permissions and
18   limitations under the License.
19   ============LICENSE_END============================================
20   ECOMP is a trademark and service mark of AT&T Intellectual Property.
21 -->
22 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
24   <modelVersion>4.0.0</modelVersion>
25   <artifactId>dmaap-bc</artifactId>
26   <version>${revision}</version>
27   <name>dmaap-bc</name>
28   <parent>
29     <groupId>org.onap.dmaap.buscontroller</groupId>
30     <artifactId>parent</artifactId>
31     <version>${revision}</version>
32     <relativePath>../pom.xml</relativePath>
33   </parent>
34   <build>
35     <finalName>dmaap-bc</finalName>
36
37     <plugins>
38       <plugin>
39         <groupId>org.apache.maven.plugins</groupId>
40         <artifactId>maven-enforcer-plugin</artifactId>
41         <executions>
42           <execution>
43             <id>enforce-no-snapshots</id>
44             <goals>
45               <goal>enforce</goal>
46             </goals>
47             <configuration>
48               <rules>
49                 <requireReleaseDeps>
50                   <message>No Snapshots Allowed!</message>
51                   <excludes>
52 <!-- for example, these might be needed...
53                     <exclude>org.onap.dmaap.dbcapi:dbcapi</exclude>
54                     <exclude>org.onap.aaf.authz:aaf-cadi-client</exclude>
55                     <exclude>org.onap.aaf.authz:aaf-misc-env</exclude>
56                     <exclude>org.onap.aaf.authz:aaf-cadi-aaf</exclude>
57                     <exclude>org.onap.aaf.authz:aaf-auth-client</exclude>
58                     <exclude>org.onap.aaf.authz:aaf-cadi-core</exclude>
59                     <exclude>org.onap.aaf.authz:aaf-misc-rosetta</exclude>
60 -->
61                   </excludes>
62                 </requireReleaseDeps>
63               </rules>
64               <fail>true</fail>
65             </configuration>
66           </execution>
67         </executions>
68       </plugin>
69
70       <!-- Package an Uber jar -->
71       <plugin>
72         <groupId>org.apache.maven.plugins</groupId>
73         <artifactId>maven-shade-plugin</artifactId>
74         <version>2.4.3</version>
75         <executions>
76           <!-- Run shade goal on package phase -->
77           <execution>
78             <phase>package</phase>
79             <goals>
80               <goal>shade</goal>
81             </goals>
82             <configuration>
83               <createDependencyReducedPom>false</createDependencyReducedPom>
84               <!-- this filter section is needed to avoid runtime error:
85                 java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
86                 suggestion found at: https://stackoverflow.com/q/999489
87               -->
88               <filters>
89                 <filter>
90                   <artifact>*:*</artifact>
91                   <excludes>
92                     <exclude>META-INF/*.SF</exclude>
93                     <exclude>META-INF/*.DSA</exclude>
94                     <exclude>META-INF/*.RSA</exclude>
95                   </excludes>
96                 </filter>
97               </filters>
98               <transformers>
99                 <!-- NOTE: Need the following transformer else gets "Could not resolve type id 'https' into a subtype" error
100                 Solution found from here:
101                 http://stackoverflow.com/questions/27543060/why-does-dropwizard-configuration-is-not-working
102                 Some more context here:
103                 https://github.com/dropwizard/dropwizard/issues/455 -->
104                 <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
105                 <!-- add Main-Class to manifest file -->
106                 <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
107                   <mainClass>org.onap.dmaap.dbcapi.server.Main</mainClass>
108                 </transformer>
109               </transformers>
110             </configuration>
111           </execution>
112         </executions>
113       </plugin>
114
115       <!-- for Distribution management -->
116       <plugin>
117         <groupId>org.apache.maven.plugins</groupId>
118         <artifactId>maven-site-plugin</artifactId>
119         <dependencies>
120           <dependency>
121             <groupId>org.apache.maven.wagon</groupId>
122             <artifactId>wagon-webdav-jackrabbit</artifactId>
123             <version>2.10</version>
124           </dependency>
125         </dependencies>
126       </plugin>
127
128     </plugins>
129     <pluginManagement>
130       <plugins>
131         <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
132         <plugin>
133           <groupId>org.eclipse.m2e</groupId>
134           <artifactId>lifecycle-mapping</artifactId>
135           <version>1.0.0</version>
136           <configuration>
137             <lifecycleMappingMetadata>
138               <pluginExecutions>
139                 <pluginExecution>
140                   <pluginExecutionFilter>
141                     <groupId>org.apache.maven.plugins</groupId>
142                     <artifactId>maven-dependency-plugin</artifactId>
143                     <versionRange>[2.10,)</versionRange>
144                     <phase>install</phase>
145                     <goals>
146                       <goal>copy-dependencies</goal>
147                     </goals>
148                   </pluginExecutionFilter>
149                   <action>
150                     <ignore/>
151                   </action>
152                 </pluginExecution>
153               </pluginExecutions>
154             </lifecycleMappingMetadata>
155           </configuration>
156         </plugin>
157       </plugins>
158     </pluginManagement>
159   </build>
160   <profiles>
161       <profile>
162         <id>docker</id>
163         <properties>
164             <skipDockerBuild>false</skipDockerBuild>
165             <skipDockerTag>false</skipDockerTag>
166             <skipTests>true</skipTests>
167         </properties>
168         <build>
169             <!-- Copy files to docker-stage to be included in image -->        
170             <resources>
171                 <resource>
172                     <targetPath>${basedir}/target/docker-stage</targetPath>
173                     <directory>${basedir}/src/main/resources</directory>
174                         <includes>
175                             <include>Dockerfile</include>
176                         </includes>
177                 </resource>
178                  <resource>
179                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/etc</targetPath>
180                     <directory>${basedir}/misc</directory>
181                         <includes>
182                           <include>LocalKey</include>
183                           <include>logback.xml</include>
184                         </includes>
185                 </resource>
186
187                  <resource>
188                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/etc</targetPath>
189                     <directory>${multiproject.basedir}</directory>
190                         <includes>
191                             <include>version.properties</include>
192                         </includes>
193                 </resource>
194                  <resource>
195                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/misc</targetPath>
196                     <directory>${basedir}/misc</directory>
197                         <includes>
198                             <include>opensource.env</include>
199                             <include>*.tmpl</include>
200                         </includes>
201                 </resource>
202                  <resource>
203                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/bin</targetPath>
204                     <directory>${basedir}/misc</directory>
205                         <includes>
206                             <include>dmaapbc</include>
207                         </includes>
208                 </resource>
209               </resources>
210             <plugins>
211               <!-- Copy jar to docker-stage to be included in image -->
212               <plugin>
213                     <artifactId>maven-resources-plugin</artifactId>
214                     <version>2.7</version>
215                     <executions>
216                        <execution>
217                             <id>copy-jar</id>
218                             <phase>package</phase>
219                             <goals>
220                                 <goal>copy-resources</goal>
221                             </goals>
222                             <configuration>
223                                 <outputDirectory>${basedir}/target/docker-stage/opt/app/dmaapbc/lib</outputDirectory>
224                                 <resources>
225                                     <resource>
226                                         <directory>${multiproject.basedir}/dmaap-bc/target</directory>
227                                         <includes>
228                                             <include>dmaap-bc.jar</include>
229                                         </includes>
230                                     </resource>
231                                 </resources>
232                             </configuration>
233                         </execution>
234                     </executions>
235                 </plugin>
236
237                 <!-- Setup image tags per https://wiki.onap.org/display/DW/Independent+Versioning+and+Release+Process#IndependentVersioningandReleaseProcess-StandardizedDockerTagging -->
238                 <plugin>
239                   <groupId>org.codehaus.groovy.maven</groupId>
240                   <artifactId>gmaven-plugin</artifactId>
241                   <executions>
242                       <execution>
243                           <phase>validate</phase>
244                           <goals>
245                               <goal>execute</goal>
246                           </goals>
247                           <configuration>
248                               <properties>
249                                   <ver>${project.version}</ver>
250                                   <timestamp>${maven.build.timestamp}</timestamp>
251                               </properties>
252                               <source>
253                                   println 'ver: ' + project.properties['ver'];
254                                   if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
255                                       project.properties['dockertag1']=project.properties['ver'] + "-latest";
256                                       project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
257                                   } else {
258                                       project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest";
259                                       project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
260                                   }
261                                   println 'docker tag 1: ' + project.properties['dockertag1'];
262                                   println 'docker tag 2: ' + project.properties['dockertag2'];
263                               </source>
264                           </configuration>
265                       </execution>
266                   </executions>
267                 </plugin>
268
269                <plugin>
270                     <groupId>io.fabric8</groupId>
271                     <artifactId>docker-maven-plugin</artifactId>
272                     <version>0.28.0</version>  
273                     <configuration>
274                         <verbose>${docker.verbose}</verbose>
275                         <apiVersion>${docker.apiVersion}</apiVersion>
276                         <pullRegistry>${docker.pull.registry}</pullRegistry>
277                         <pushRegistry>${docker.push.registry}</pushRegistry>
278                         <images>
279                             <image>                            
280                                 <name>${docker.image}</name>
281                                 <build>
282                                     <cleanup>try</cleanup>
283                                     <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
284                                     <dockerFile>Dockerfile</dockerFile>
285                                     <tags>
286                                         <tag>${dockertag1}</tag>
287                                         <tag>${dockertag2}</tag>
288                                     </tags>
289                                 </build>
290                             </image>
291                         </images>
292                     </configuration>
293                      <executions>
294                          <execution>
295                              <id>generate-images</id>
296                              <phase>install</phase>
297                              <goals>
298                                  <goal>build</goal>
299                              </goals>
300                          </execution>
301                          <execution>
302                              <id>push-images</id>
303                              <phase>deploy</phase>
304                              <goals>
305                                  <goal>push</goal>
306                              </goals>
307                          </execution>
308                      </executions>
309                 </plugin>
310             </plugins>
311         </build>
312     </profile>
313   </profiles>
314   <dependencyManagement>
315     <dependencies>
316       <dependency>
317         <groupId>org.glassfish.jersey</groupId>
318         <artifactId>jersey-bom</artifactId>
319         <version>${jersey.version}</version>
320         <type>pom</type>
321         <scope>import</scope>
322       </dependency>
323     </dependencies>
324   </dependencyManagement>
325   <dependencies>
326     <dependency>
327       <groupId>org.onap.aaf.authz</groupId>
328       <artifactId>aaf-cadi-aaf</artifactId>
329       <version>2.1.7</version>
330       <classifier>full</classifier>
331     </dependency>
332     <dependency>
333       <groupId>com.fasterxml.jackson.core</groupId>
334       <artifactId>jackson-annotations</artifactId>
335       <version>2.9.5</version>
336     </dependency>
337     <dependency>
338       <groupId>com.fasterxml.jackson.dataformat</groupId>
339       <artifactId>jackson-dataformat-yaml</artifactId>
340       <version>2.9.5</version>
341     </dependency>
342     <dependency>
343       <groupId>ch.qos.logback</groupId>
344       <artifactId>logback-core</artifactId>
345       <version>1.2.3</version>
346     </dependency>
347     <dependency>
348       <groupId>ch.qos.logback</groupId>
349       <artifactId>logback-classic</artifactId>
350       <version>1.2.3</version>
351     </dependency>
352     <dependency>
353       <groupId>com.google.guava</groupId>
354       <artifactId>guava</artifactId>
355       <version>24.1.1-jre</version>
356     </dependency>
357     <dependency>
358       <groupId>io.swagger</groupId>
359       <artifactId>swagger-core</artifactId>
360       <version>${swagger.version}</version>
361     </dependency>
362     <dependency>
363       <groupId>io.swagger</groupId>
364       <artifactId>swagger-jersey2-jaxrs</artifactId>
365       <version>${swagger.version}</version>
366     </dependency>
367     <dependency>
368       <groupId>io.swagger</groupId>
369       <artifactId>swagger-annotations</artifactId>
370       <version>${swagger.version}</version>
371     </dependency>
372     <dependency>
373       <groupId>org.glassfish.jersey.containers</groupId>
374       <artifactId>jersey-container-servlet-core</artifactId>
375       <!-- use the following artifactId if you don't need servlet 2.x compatibility -->
376       <!-- artifactId>jersey-container-servlet</artifactId -->
377     </dependency>
378     <dependency>
379       <groupId>org.glassfish.jersey.media</groupId>
380       <artifactId>jersey-media-moxy</artifactId>
381     </dependency>
382     <dependency>
383       <groupId>org.apache.logging.log4j</groupId>
384       <artifactId>log4j-api</artifactId>
385       <version>${log4j.version}</version>
386     </dependency>
387     <dependency>
388       <groupId>org.apache.logging.log4j</groupId>
389       <artifactId>log4j-core</artifactId>
390       <version>${log4j.version}</version>
391     </dependency>
392     <dependency>
393       <groupId>org.eclipse.jetty</groupId>
394       <artifactId>jetty-server</artifactId>
395       <version>${jettyVersion}</version>
396     </dependency>
397     <dependency>
398       <groupId>org.eclipse.jetty</groupId>
399       <artifactId>jetty-servlet</artifactId>
400       <version>${jettyVersion}</version>
401       <scope>compile</scope>
402     </dependency>
403     <dependency>
404       <groupId>org.eclipse.jetty</groupId>
405       <artifactId>jetty-servlets</artifactId>
406       <version>${jettyVersion}</version>
407       <scope>compile</scope>
408     </dependency>
409     <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
410     <dependency>
411       <groupId>com.googlecode.json-simple</groupId>
412       <artifactId>json-simple</artifactId>
413       <version>1.1.1</version>
414     </dependency>
415     <dependency>
416       <groupId>commons-codec</groupId>
417       <artifactId>commons-codec</artifactId>
418       <version>1.15</version>
419     </dependency>
420     <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
421     <dependency>
422       <groupId>org.postgresql</groupId>
423       <artifactId>postgresql</artifactId>
424       <version>42.2.14</version>
425     </dependency>
426     <dependency>
427       <groupId>org.onap.dmaap.dbcapi</groupId>
428       <artifactId>dbcapi</artifactId>
429       <version>2.0.4</version>
430     </dependency>
431     <dependency>
432       <groupId>com.att.eelf</groupId>
433       <artifactId>eelf-core</artifactId>
434       <version>${eelf.version}</version>
435     </dependency>
436     <dependency>
437       <groupId>org.slf4j</groupId>
438       <artifactId>slf4j-api</artifactId>
439       <version>1.7.22</version>
440     </dependency>
441     <dependency>
442       <groupId>org.glassfish.jersey.test-framework.providers</groupId>
443       <!-- use this if compatibility issues with jetty artifactId:
444       <artifactId>jersey-test-framework-provider-jetty</artifactId>
445           <version>${jersey.version}</version>
446       -->
447       <artifactId>jersey-test-framework-provider-jdk-http</artifactId>
448       <version>2.29.1</version>
449     </dependency>
450     <dependency>
451       <groupId>org.glassfish.jersey.inject</groupId>
452       <artifactId>jersey-hk2</artifactId>
453       <version>2.29.1</version>
454     </dependency>
455     <dependency>
456       <!-- use 2.3.1 to avoid this issue: https://github.com/eclipse-ee4j/jaxb-ri/issues/1222 -->
457       <groupId>javax.xml.bind</groupId>
458       <artifactId>jaxb-api</artifactId>
459       <version>2.3.1</version>
460     </dependency>
461     <dependency>
462       <groupId>javax.activation</groupId>
463       <artifactId>javax.activation-api</artifactId>
464       <version>1.2.0</version>
465     </dependency>
466
467     <dependency>
468       <groupId>junit</groupId>
469       <artifactId>junit</artifactId>
470       <version>4.12</version>
471       <scope>test</scope>
472     </dependency>
473     <dependency>
474       <groupId>pl.pragmatists</groupId>
475       <artifactId>JUnitParams</artifactId>
476       <version>1.1.0</version>
477       <scope>test</scope>
478     </dependency>
479     <dependency>
480       <groupId>org.apache.maven.plugins</groupId>
481       <artifactId>maven-enforcer-plugin</artifactId>
482       <version>3.0.0-M3</version>
483     </dependency>
484   </dependencies>
485   <reporting>
486     <plugins>
487       <plugin>
488         <groupId>org.apache.maven.plugins</groupId>
489         <artifactId>maven-javadoc-plugin</artifactId>
490         <version>2.10.4</version>
491         <configuration>
492           <failOnError>false</failOnError>
493           <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
494           <docletArtifact>
495             <groupId>org.umlgraph</groupId>
496             <artifactId>umlgraph</artifactId>
497             <version>5.6</version>
498           </docletArtifact>
499           <additionalparam>-views</additionalparam>
500           <useStandardDocletOptions>true</useStandardDocletOptions>
501         </configuration>
502       </plugin>
503     </plugins>
504   </reporting>
505
506   <distributionManagement>
507     <site>
508       <id>ecomp-site</id>
509       <url>dav:${nexusproxy}${sitePath}</url>
510     </site>
511   </distributionManagement>
512   <properties>
513     <multiproject.basedir>${basedir}/..</multiproject.basedir>
514     <docker.maven.plugin.version>1.0.0</docker.maven.plugin.version>
515     <jersey.version>2.29</jersey.version>
516     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
517     <log4j.version>2.13.3</log4j.version>
518     <jettyVersion>9.4.36.v20210114</jettyVersion>
519     <eelf.version>1.0.0</eelf.version>
520     <swagger.version>1.5.19</swagger.version>
521     <timestamp>${maven.build.timestamp}</timestamp>
522     <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
523     <!--  SONAR  -->
524     <jacoco.version>0.7.7.201606060606</jacoco.version>
525     <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
526     <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
527     <!-- Default Sonar configuration -->
528     <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
529     <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
530     <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
531     <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
532
533     <!-- docker image -->
534     <docker.image>onap/dmaap/dmaap-bc</docker.image>
535
536     <nexusproxy>https://nexus.onap.org</nexusproxy>
537     <docker.push.registry>10.12.5.45:5000</docker.push.registry>
538
539     <timestamp>${maven.build.timestamp}</timestamp>
540     <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
541
542     <!-- for Distribution Management -->
543     <sitePath>/content/sites/site/org/onap/dmaap/dmaap-bc/${revision}</sitePath>
544   </properties>
545   <description>Packaging Platform (DMaaP) Bus Controller API as a Docker container.</description>
546 </project>