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