newest version used
[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   <groupId>org.onap.dmaap.buscontroller</groupId>
26   <artifactId>dmaap-bc</artifactId>
27   <version>${artifact.version}</version>
28   <name>dmaap-bc</name>
29   <parent>
30     <groupId>org.onap.oparent</groupId>
31     <artifactId>oparent</artifactId>
32     <version>1.2.2</version>
33     <relativePath/>
34   </parent>
35   <build>
36     <finalName>dmaap-bc</finalName>
37
38     <plugins>
39       <plugin>
40         <groupId>org.apache.maven.plugins</groupId>
41         <artifactId>maven-enforcer-plugin</artifactId>
42         <executions>
43           <execution>
44             <id>enforce-no-snapshots</id>
45             <goals>
46               <goal>enforce</goal>
47             </goals>
48             <configuration>
49               <rules>
50                 <requireReleaseDeps>
51                   <message>No Snapshots Allowed!</message>
52                   <excludes>
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                   </excludes>
61                 </requireReleaseDeps>
62               </rules>
63               <fail>true</fail>
64             </configuration>
65           </execution>
66         </executions>
67       </plugin>
68
69       <!-- Package an Uber jar -->
70       <plugin>
71         <groupId>org.apache.maven.plugins</groupId>
72         <artifactId>maven-shade-plugin</artifactId>
73         <version>2.4.3</version>
74         <executions>
75           <!-- Run shade goal on package phase -->
76           <execution>
77             <phase>package</phase>
78             <goals>
79               <goal>shade</goal>
80             </goals>
81             <configuration>
82               <createDependencyReducedPom>false</createDependencyReducedPom>
83               <!-- this filter section is needed to avoid runtime error:
84                 java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
85                 suggestion found at: https://stackoverflow.com/q/999489
86               -->
87               <filters>
88                 <filter>
89                   <artifact>*:*</artifact>
90                   <excludes>
91                     <exclude>META-INF/*.SF</exclude>
92                     <exclude>META-INF/*.DSA</exclude>
93                     <exclude>META-INF/*.RSA</exclude>
94                   </excludes>
95                 </filter>
96               </filters>
97               <transformers>
98                 <!-- NOTE: Need the following transformer else gets "Could not resolve type id 'https' into a subtype" error
99                 Solution found from here:
100                 http://stackoverflow.com/questions/27543060/why-does-dropwizard-configuration-is-not-working
101                 Some more context here:
102                 https://github.com/dropwizard/dropwizard/issues/455 -->
103                 <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
104                 <!-- add Main-Class to manifest file -->
105                 <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
106                   <mainClass>org.onap.dmaap.dbcapi.server.Main</mainClass>
107                 </transformer>
108               </transformers>
109             </configuration>
110           </execution>
111         </executions>
112       </plugin>
113
114       <plugin>
115         <groupId>org.sonatype.plugins</groupId>
116         <artifactId>nexus-staging-maven-plugin</artifactId>
117         <extensions>true</extensions>
118         <configuration>
119           <serverId>ecomp-staging</serverId>
120           <nexusUrl>${nexusproxy}</nexusUrl>
121           <stagingProfileId>176c31dfe190a</stagingProfileId>
122         </configuration>
123       </plugin>
124
125       <!-- for Distribution management -->
126       <plugin>
127         <groupId>org.apache.maven.plugins</groupId>
128         <artifactId>maven-site-plugin</artifactId>
129         <dependencies>
130           <dependency>
131             <groupId>org.apache.maven.wagon</groupId>
132             <artifactId>wagon-webdav-jackrabbit</artifactId>
133             <version>2.10</version>
134           </dependency>
135         </dependencies>
136       </plugin>
137
138     </plugins>
139     <pluginManagement>
140       <plugins>
141         <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
142         <plugin>
143           <groupId>org.eclipse.m2e</groupId>
144           <artifactId>lifecycle-mapping</artifactId>
145           <version>1.0.0</version>
146           <configuration>
147             <lifecycleMappingMetadata>
148               <pluginExecutions>
149                 <pluginExecution>
150                   <pluginExecutionFilter>
151                     <groupId>org.apache.maven.plugins</groupId>
152                     <artifactId>maven-dependency-plugin</artifactId>
153                     <versionRange>[2.10,)</versionRange>
154                     <phase>install</phase>
155                     <goals>
156                       <goal>copy-dependencies</goal>
157                     </goals>
158                   </pluginExecutionFilter>
159                   <action>
160                     <ignore/>
161                   </action>
162                 </pluginExecution>
163               </pluginExecutions>
164             </lifecycleMappingMetadata>
165           </configuration>
166         </plugin>
167       </plugins>
168     </pluginManagement>
169   </build>
170   <profiles>
171       <profile>
172         <id>docker</id>
173         <properties>
174             <skipDockerBuild>false</skipDockerBuild>
175             <skipDockerTag>false</skipDockerTag>
176             <skipTests>true</skipTests>
177         </properties>
178         <build>
179             <!-- Copy files to docker-stage to be included in image -->        
180             <resources>
181                 <resource>
182                     <targetPath>${basedir}/target/docker-stage</targetPath>
183                     <directory>${basedir}/src/main/resources</directory>
184                         <includes>
185                             <include>Dockerfile</include>
186                         </includes>
187                 </resource>
188                  <resource>
189                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/etc</targetPath>
190                     <directory>${multiproject.basedir}/certs</directory>
191                         <includes>
192                           <include>org.onap.dmaap-bc.cred.props</include>
193                           <include>org.onap.dmaap-bc.crontab.sh</include>
194                           <include>org.onap.dmaap-bc.jks</include>
195                           <include>org.onap.dmaap-bc.keyfile</include>
196                           <include>org.onap.dmaap-bc.location.props</include>
197                           <include>org.onap.dmaap-bc.p12</include>
198                           <include>org.onap.dmaap-bc.props</include>
199                           <include>org.onap.dmaap-bc.showpass</include>
200                           <include>org.onap.dmaap-bc.trust.jks</include>
201                         </includes>
202                 </resource>
203                  <resource>
204                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/misc</targetPath>
205                     <directory>${multiproject.basedir}/misc</directory>
206                         <includes>
207                             <include>cert-client-init.sh</include>
208                             <include>aaf-ca.crt</include>
209                         </includes>
210                 </resource>
211                  <resource>
212                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/etc</targetPath>
213                     <directory>${basedir}/misc</directory>
214                         <includes>
215                           <include>LocalKey</include>
216                           <include>logback.xml</include>
217                         </includes>
218                 </resource>
219
220                  <resource>
221                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/etc</targetPath>
222                     <directory>${multiproject.basedir}</directory>
223                         <includes>
224                             <include>version.properties</include>
225                         </includes>
226                 </resource>
227                  <resource>
228                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/misc</targetPath>
229                     <directory>${basedir}/misc</directory>
230                         <includes>
231                             <include>opensource.env</include>
232                             <include>*.tmpl</include>
233                         </includes>
234                 </resource>
235                  <resource>
236                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/bin</targetPath>
237                     <directory>${basedir}/misc</directory>
238                         <includes>
239                             <include>dmaapbc</include>
240                             <include>doaction</include>
241                         </includes>
242                 </resource>
243               </resources>
244             <plugins>
245               <!-- Copy jar to docker-stage to be included in image -->
246               <plugin>
247                     <artifactId>maven-resources-plugin</artifactId>
248                     <version>2.7</version>
249                     <executions>
250                        <execution>
251                             <id>copy-jar</id>
252                             <phase>package</phase>
253                             <goals>
254                                 <goal>copy-resources</goal>
255                             </goals>
256                             <configuration>
257                                 <outputDirectory>${basedir}/target/docker-stage/opt/app/dmaapbc/lib</outputDirectory>
258                                 <resources>
259                                     <resource>
260                                         <directory>${multiproject.basedir}/dmaap-bc/target</directory>
261                                         <includes>
262                                             <include>dmaap-bc.jar</include>
263                                         </includes>
264                                     </resource>
265                                 </resources>
266                             </configuration>
267                         </execution>
268                     </executions>
269                 </plugin>
270
271                 <!-- Setup image tags per https://wiki.onap.org/display/DW/Independent+Versioning+and+Release+Process#IndependentVersioningandReleaseProcess-StandardizedDockerTagging -->
272                 <plugin>
273                   <groupId>org.codehaus.groovy.maven</groupId>
274                   <artifactId>gmaven-plugin</artifactId>
275                   <executions>
276                       <execution>
277                           <phase>validate</phase>
278                           <goals>
279                               <goal>execute</goal>
280                           </goals>
281                           <configuration>
282                               <properties>
283                                   <ver>${project.version}</ver>
284                                   <timestamp>${maven.build.timestamp}</timestamp>
285                               </properties>
286                               <source>
287                                   println 'ver: ' + project.properties['ver'];
288                                   if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
289                                       project.properties['dockertag1']=project.properties['ver'] + "-latest";
290                                       project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
291                                   } else {
292                                       project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest";
293                                       project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
294                                   }
295                                   println 'docker tag 1: ' + project.properties['dockertag1'];
296                                   println 'docker tag 2: ' + project.properties['dockertag2'];
297                               </source>
298                           </configuration>
299                       </execution>
300                   </executions>
301                 </plugin>
302
303                <plugin>
304                     <groupId>io.fabric8</groupId>
305                     <artifactId>docker-maven-plugin</artifactId>
306                     <version>0.28.0</version>  
307                     <configuration>
308                         <verbose>${docker.verbose}</verbose>
309                         <apiVersion>${docker.apiVersion}</apiVersion>
310                         <pullRegistry>${docker.pull.registry}</pullRegistry>
311                         <pushRegistry>${docker.push.registry}</pushRegistry>
312                         <images>
313                             <image>                            
314                                 <name>${docker.image}</name>
315                                 <build>
316                                     <cleanup>try</cleanup>
317                                     <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
318                                     <dockerFile>Dockerfile</dockerFile>
319                                     <tags>
320                                         <tag>${dockertag1}</tag>
321                                         <tag>${dockertag2}</tag>
322                                     </tags>
323                                 </build>
324                             </image>
325                         </images>
326                     </configuration>
327                      <executions>
328                          <execution>
329                              <id>generate-images</id>
330                              <phase>install</phase>
331                              <goals>
332                                  <goal>build</goal>
333                              </goals>
334                          </execution>
335                          <execution>
336                              <id>push-images</id>
337                              <phase>deploy</phase>
338                              <goals>
339                                  <goal>push</goal>
340                              </goals>
341                          </execution>
342                      </executions>
343                 </plugin>
344             </plugins>
345         </build>
346     </profile>
347   </profiles>
348   <dependencyManagement>
349     <dependencies>
350       <dependency>
351         <groupId>org.glassfish.jersey</groupId>
352         <artifactId>jersey-bom</artifactId>
353         <version>${jersey.version}</version>
354         <type>pom</type>
355         <scope>import</scope>
356       </dependency>
357     </dependencies>
358   </dependencyManagement>
359   <dependencies>
360     <dependency>
361       <groupId>io.swagger</groupId>
362       <artifactId>swagger-core</artifactId>
363       <version>${swagger.version}</version>
364     </dependency>
365     <dependency>
366       <groupId>io.swagger</groupId>
367       <artifactId>swagger-jersey2-jaxrs</artifactId>
368       <version>${swagger.version}</version>
369     </dependency>
370     <dependency>
371       <groupId>io.swagger</groupId>
372       <artifactId>swagger-annotations</artifactId>
373       <version>${swagger.version}</version>
374     </dependency>
375     <dependency>
376       <groupId>org.glassfish.jersey.containers</groupId>
377       <artifactId>jersey-container-servlet-core</artifactId>
378       <!-- use the following artifactId if you don't need servlet 2.x compatibility -->
379       <!-- artifactId>jersey-container-servlet</artifactId -->
380     </dependency>
381     <dependency>
382       <groupId>org.glassfish.jersey.media</groupId>
383       <artifactId>jersey-media-moxy</artifactId>
384     </dependency>
385     <dependency>
386       <groupId>log4j</groupId>
387       <artifactId>log4j</artifactId>
388       <version>1.2.17</version>
389     </dependency>
390     <dependency>
391       <groupId>org.eclipse.jetty</groupId>
392       <artifactId>jetty-server</artifactId>
393       <version>${jettyVersion}</version>
394     </dependency>
395     <dependency>
396       <groupId>org.onap.aaf.authz</groupId>
397       <artifactId>aaf-cadi-aaf</artifactId>
398       <version>2.1.7</version>
399       <classifier>full</classifier>
400     </dependency>
401
402     <dependency>
403       <groupId>org.eclipse.jetty</groupId>
404       <artifactId>jetty-servlet</artifactId>
405       <version>${jettyVersion}</version>
406       <scope>compile</scope>
407     </dependency>
408     <dependency>
409       <groupId>org.eclipse.jetty</groupId>
410       <artifactId>jetty-servlets</artifactId>
411       <version>${jettyVersion}</version>
412       <scope>compile</scope>
413     </dependency>
414     <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
415     <dependency>
416       <groupId>com.googlecode.json-simple</groupId>
417       <artifactId>json-simple</artifactId>
418       <version>1.1.1</version>
419     </dependency>
420     <dependency>
421       <groupId>commons-codec</groupId>
422       <artifactId>commons-codec</artifactId>
423       <version>1.11</version>
424     </dependency>
425     <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
426     <dependency>
427       <groupId>org.postgresql</groupId>
428       <artifactId>postgresql</artifactId>
429       <version>42.2.5</version>
430     </dependency>
431
432     <dependency>
433       <groupId>org.onap.dmaap.dbcapi</groupId>
434       <artifactId>dbcapi</artifactId>
435       <version>1.0.29-SNAPSHOT</version>
436     </dependency>
437   </dependencies>
438   <reporting>
439     <plugins>
440       <plugin>
441         <groupId>org.apache.maven.plugins</groupId>
442         <artifactId>maven-javadoc-plugin</artifactId>
443         <version>2.10.4</version>
444         <configuration>
445           <failOnError>false</failOnError>
446           <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
447           <docletArtifact>
448             <groupId>org.umlgraph</groupId>
449             <artifactId>umlgraph</artifactId>
450             <version>5.6</version>
451           </docletArtifact>
452           <additionalparam>-views</additionalparam>
453           <useStandardDocletOptions>true</useStandardDocletOptions>
454         </configuration>
455       </plugin>
456     </plugins>
457   </reporting>
458
459   <distributionManagement>
460     <site>
461       <id>ecomp-site</id>
462       <url>dav:${nexusproxy}${sitePath}</url>
463     </site>
464   </distributionManagement>
465   <properties>
466     <multiproject.basedir>${basedir}/..</multiproject.basedir>
467     <docker.maven.plugin.version>1.0.0</docker.maven.plugin.version>
468     <jersey.version>2.16</jersey.version>
469     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
470     <jettyVersion>9.4.12.RC2</jettyVersion>
471     <eelf.version>1.0.0</eelf.version>
472     <swagger.version>1.5.19</swagger.version>
473     <artifact.version>1.1.6</artifact.version>
474     <timestamp>${maven.build.timestamp}</timestamp>
475     <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
476     <!--  SONAR  -->
477     <jacoco.version>0.7.7.201606060606</jacoco.version>
478     <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
479     <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
480     <!-- Default Sonar configuration -->
481     <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
482     <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
483     <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
484     <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
485
486     <!-- docker image -->
487     <docker.image>onap/dmaap/dmaap-bc</docker.image>
488
489     <nexusproxy>https://nexus.onap.org</nexusproxy>
490     <docker.push.registry>10.12.5.45:5000</docker.push.registry>
491
492     <timestamp>${maven.build.timestamp}</timestamp>
493     <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
494
495     <!-- for Distribution Management -->
496     <sitePath>/content/sites/site/org/onap/dmaap/dmaap-bc/${artifact.version}</sitePath>
497   </properties>
498   <description>Packaging Platform (DMaaP) Bus Controller API as a Docker container.</description>
499 </project>