b1918253469b0ee2aae2f3cc24f311ebfbcb7f07
[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/misc</targetPath>
180                     <directory>${multiproject.basedir}/misc</directory>
181                         <includes>
182                             <include>cert-client-init.sh</include>
183                             <include>aaf-ca.crt</include>
184                         </includes>
185                 </resource>
186                  <resource>
187                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/etc</targetPath>
188                     <directory>${basedir}/misc</directory>
189                         <includes>
190                           <include>LocalKey</include>
191                           <include>logback.xml</include>
192                         </includes>
193                 </resource>
194
195                  <resource>
196                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/etc</targetPath>
197                     <directory>${multiproject.basedir}</directory>
198                         <includes>
199                             <include>version.properties</include>
200                         </includes>
201                 </resource>
202                  <resource>
203                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/misc</targetPath>
204                     <directory>${basedir}/misc</directory>
205                         <includes>
206                             <include>opensource.env</include>
207                             <include>*.tmpl</include>
208                         </includes>
209                 </resource>
210                  <resource>
211                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/bin</targetPath>
212                     <directory>${basedir}/misc</directory>
213                         <includes>
214                             <include>dmaapbc</include>
215                         </includes>
216                 </resource>
217               </resources>
218             <plugins>
219               <!-- Copy jar to docker-stage to be included in image -->
220               <plugin>
221                     <artifactId>maven-resources-plugin</artifactId>
222                     <version>2.7</version>
223                     <executions>
224                        <execution>
225                             <id>copy-jar</id>
226                             <phase>package</phase>
227                             <goals>
228                                 <goal>copy-resources</goal>
229                             </goals>
230                             <configuration>
231                                 <outputDirectory>${basedir}/target/docker-stage/opt/app/dmaapbc/lib</outputDirectory>
232                                 <resources>
233                                     <resource>
234                                         <directory>${multiproject.basedir}/dmaap-bc/target</directory>
235                                         <includes>
236                                             <include>dmaap-bc.jar</include>
237                                         </includes>
238                                     </resource>
239                                 </resources>
240                             </configuration>
241                         </execution>
242                     </executions>
243                 </plugin>
244
245                 <!-- Setup image tags per https://wiki.onap.org/display/DW/Independent+Versioning+and+Release+Process#IndependentVersioningandReleaseProcess-StandardizedDockerTagging -->
246                 <plugin>
247                   <groupId>org.codehaus.groovy.maven</groupId>
248                   <artifactId>gmaven-plugin</artifactId>
249                   <executions>
250                       <execution>
251                           <phase>validate</phase>
252                           <goals>
253                               <goal>execute</goal>
254                           </goals>
255                           <configuration>
256                               <properties>
257                                   <ver>${project.version}</ver>
258                                   <timestamp>${maven.build.timestamp}</timestamp>
259                               </properties>
260                               <source>
261                                   println 'ver: ' + project.properties['ver'];
262                                   if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
263                                       project.properties['dockertag1']=project.properties['ver'] + "-latest";
264                                       project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
265                                   } else {
266                                       project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest";
267                                       project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
268                                   }
269                                   println 'docker tag 1: ' + project.properties['dockertag1'];
270                                   println 'docker tag 2: ' + project.properties['dockertag2'];
271                               </source>
272                           </configuration>
273                       </execution>
274                   </executions>
275                 </plugin>
276
277                <plugin>
278                     <groupId>io.fabric8</groupId>
279                     <artifactId>docker-maven-plugin</artifactId>
280                     <version>0.28.0</version>  
281                     <configuration>
282                         <verbose>${docker.verbose}</verbose>
283                         <apiVersion>${docker.apiVersion}</apiVersion>
284                         <pullRegistry>${docker.pull.registry}</pullRegistry>
285                         <pushRegistry>${docker.push.registry}</pushRegistry>
286                         <images>
287                             <image>                            
288                                 <name>${docker.image}</name>
289                                 <build>
290                                     <cleanup>try</cleanup>
291                                     <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
292                                     <dockerFile>Dockerfile</dockerFile>
293                                     <tags>
294                                         <tag>${dockertag1}</tag>
295                                         <tag>${dockertag2}</tag>
296                                     </tags>
297                                 </build>
298                             </image>
299                         </images>
300                     </configuration>
301                      <executions>
302                          <execution>
303                              <id>generate-images</id>
304                              <phase>install</phase>
305                              <goals>
306                                  <goal>build</goal>
307                              </goals>
308                          </execution>
309                          <execution>
310                              <id>push-images</id>
311                              <phase>deploy</phase>
312                              <goals>
313                                  <goal>push</goal>
314                              </goals>
315                          </execution>
316                      </executions>
317                 </plugin>
318             </plugins>
319         </build>
320     </profile>
321   </profiles>
322   <dependencyManagement>
323     <dependencies>
324       <dependency>
325         <groupId>org.glassfish.jersey</groupId>
326         <artifactId>jersey-bom</artifactId>
327         <version>${jersey.version}</version>
328         <type>pom</type>
329         <scope>import</scope>
330       </dependency>
331     </dependencies>
332   </dependencyManagement>
333   <dependencies>
334     <dependency>
335       <groupId>io.swagger</groupId>
336       <artifactId>swagger-core</artifactId>
337       <version>${swagger.version}</version>
338     </dependency>
339     <dependency>
340       <groupId>io.swagger</groupId>
341       <artifactId>swagger-jersey2-jaxrs</artifactId>
342       <version>${swagger.version}</version>
343     </dependency>
344     <dependency>
345       <groupId>io.swagger</groupId>
346       <artifactId>swagger-annotations</artifactId>
347       <version>${swagger.version}</version>
348     </dependency>
349     <dependency>
350       <groupId>org.glassfish.jersey.containers</groupId>
351       <artifactId>jersey-container-servlet-core</artifactId>
352       <!-- use the following artifactId if you don't need servlet 2.x compatibility -->
353       <!-- artifactId>jersey-container-servlet</artifactId -->
354     </dependency>
355     <dependency>
356       <groupId>org.glassfish.jersey.media</groupId>
357       <artifactId>jersey-media-moxy</artifactId>
358     </dependency>
359     <dependency>
360       <groupId>org.apache.logging.log4j</groupId>
361       <artifactId>log4j-api</artifactId>
362       <version>${log4j.version}</version>
363     </dependency>
364     <dependency>
365       <groupId>org.apache.logging.log4j</groupId>
366       <artifactId>log4j-core</artifactId>
367       <version>${log4j.version}</version>
368     </dependency>
369     <dependency>
370       <groupId>org.eclipse.jetty</groupId>
371       <artifactId>jetty-server</artifactId>
372       <version>${jettyVersion}</version>
373     </dependency>
374     <dependency>
375       <groupId>org.eclipse.jetty</groupId>
376       <artifactId>jetty-util</artifactId>
377       <version>${jettyVersion}</version>
378     </dependency>
379     <dependency>
380       <groupId>org.onap.aaf.authz</groupId>
381       <artifactId>aaf-cadi-aaf</artifactId>
382       <version>2.1.7</version>
383       <classifier>full</classifier>
384     </dependency>
385     <dependency>
386       <groupId>org.eclipse.jetty</groupId>
387       <artifactId>jetty-servlet</artifactId>
388       <version>${jettyVersion}</version>
389       <scope>compile</scope>
390     </dependency>
391     <dependency>
392       <groupId>org.eclipse.jetty</groupId>
393       <artifactId>jetty-servlets</artifactId>
394       <version>${jettyVersion}</version>
395       <scope>compile</scope>
396     </dependency>
397     <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
398     <dependency>
399       <groupId>com.googlecode.json-simple</groupId>
400       <artifactId>json-simple</artifactId>
401       <version>1.1.1</version>
402     </dependency>
403     <dependency>
404       <groupId>commons-codec</groupId>
405       <artifactId>commons-codec</artifactId>
406       <version>1.15</version>
407     </dependency>
408     <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
409     <dependency>
410       <groupId>org.postgresql</groupId>
411       <artifactId>postgresql</artifactId>
412       <version>42.2.14</version>
413     </dependency>
414     <dependency>
415       <groupId>org.onap.dmaap.dbcapi</groupId>
416       <artifactId>dbcapi</artifactId>
417       <version>2.0.3</version>
418     </dependency>
419   </dependencies>
420   <reporting>
421     <plugins>
422       <plugin>
423         <groupId>org.apache.maven.plugins</groupId>
424         <artifactId>maven-javadoc-plugin</artifactId>
425         <version>2.10.4</version>
426         <configuration>
427           <failOnError>false</failOnError>
428           <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
429           <docletArtifact>
430             <groupId>org.umlgraph</groupId>
431             <artifactId>umlgraph</artifactId>
432             <version>5.6</version>
433           </docletArtifact>
434           <additionalparam>-views</additionalparam>
435           <useStandardDocletOptions>true</useStandardDocletOptions>
436         </configuration>
437       </plugin>
438     </plugins>
439   </reporting>
440
441   <distributionManagement>
442     <site>
443       <id>ecomp-site</id>
444       <url>dav:${nexusproxy}${sitePath}</url>
445     </site>
446   </distributionManagement>
447   <properties>
448     <multiproject.basedir>${basedir}/..</multiproject.basedir>
449     <docker.maven.plugin.version>1.0.0</docker.maven.plugin.version>
450     <jersey.version>2.29</jersey.version>
451     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
452     <log4j.version>2.13.3</log4j.version>
453     <jettyVersion>9.4.36.v20210114</jettyVersion>
454     <eelf.version>1.0.0</eelf.version>
455     <swagger.version>1.5.19</swagger.version>
456     <timestamp>${maven.build.timestamp}</timestamp>
457     <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
458     <!--  SONAR  -->
459     <jacoco.version>0.7.7.201606060606</jacoco.version>
460     <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
461     <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
462     <!-- Default Sonar configuration -->
463     <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
464     <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
465     <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
466     <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
467
468     <!-- docker image -->
469     <docker.image>onap/dmaap/dmaap-bc</docker.image>
470
471     <nexusproxy>https://nexus.onap.org</nexusproxy>
472     <docker.push.registry>10.12.5.45:5000</docker.push.registry>
473
474     <timestamp>${maven.build.timestamp}</timestamp>
475     <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
476
477     <!-- for Distribution Management -->
478     <sitePath>/content/sites/site/org/onap/dmaap/dmaap-bc/${revision}</sitePath>
479   </properties>
480   <description>Packaging Platform (DMaaP) Bus Controller API as a Docker container.</description>
481 </project>