e4b64edf0c25e7c4b74780aa0618236ac79bfb3f
[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>${basedir}/misc</directory>
191                         <includes>
192                           <include>LocalKey</include>
193                           <include>logback.xml</include>
194                           <include>org.onap.dmaap-bc.trust.jks</include>
195                           <include>dbc-api.jks</include>
196                         </includes>
197                 </resource>
198                  <resource>
199                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/etc</targetPath>
200                     <directory>${basedir}</directory>
201                         <includes>
202                             <include>version.properties</include>
203                         </includes>
204                 </resource>
205                  <resource>
206                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/misc</targetPath>
207                     <directory>${basedir}/misc</directory>
208                         <includes>
209                             <include>opensource.env</include>
210                             <include>*.tmpl</include>
211                         </includes>
212                 </resource>
213                  <resource>
214                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/misc</targetPath>
215                     <directory>${multiproject.basedir}/misc</directory>
216                         <includes>
217                             <include>cert-client-init.sh</include>
218                         </includes>
219                 </resource>
220                  <resource>
221                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/bin</targetPath>
222                     <directory>${basedir}/misc</directory>
223                         <includes>
224                             <include>dmaapbc</include>
225                             <include>doaction</include>
226                         </includes>
227                 </resource>
228               </resources>
229             <plugins>
230               <!-- Copy jar to docker-stage to be included in image -->
231               <plugin>
232                     <artifactId>maven-resources-plugin</artifactId>
233                     <version>2.7</version>
234                     <executions>
235                        <execution>
236                             <id>copy-jar</id>
237                             <phase>package</phase>
238                             <goals>
239                                 <goal>copy-resources</goal>
240                             </goals>
241                             <configuration>
242                                 <outputDirectory>${basedir}/target/docker-stage/opt/app/dmaapbc/lib</outputDirectory>
243                                 <resources>
244                                     <resource>
245                                         <directory>${multiproject.basedir}/dmaap-bc/target</directory>
246                                         <includes>
247                                             <include>dmaap-bc.jar</include>
248                                         </includes>
249                                     </resource>
250                                 </resources>
251                             </configuration>
252                         </execution>
253                     </executions>
254                 </plugin>
255
256                 <!-- Setup image tags per https://wiki.onap.org/display/DW/Independent+Versioning+and+Release+Process#IndependentVersioningandReleaseProcess-StandardizedDockerTagging -->
257                 <plugin>
258                   <groupId>org.codehaus.groovy.maven</groupId>
259                   <artifactId>gmaven-plugin</artifactId>
260                   <executions>
261                       <execution>
262                           <phase>validate</phase>
263                           <goals>
264                               <goal>execute</goal>
265                           </goals>
266                           <configuration>
267                               <properties>
268                                   <ver>${project.version}</ver>
269                                   <timestamp>${maven.build.timestamp}</timestamp>
270                               </properties>
271                               <source>
272                                   println 'ver: ' + project.properties['ver'];
273                                   if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
274                                       project.properties['dockertag1']=project.properties['ver'] + "-latest";
275                                       project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
276                                   } else {
277                                       project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest";
278                                       project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
279                                   }
280                                   println 'docker tag 1: ' + project.properties['dockertag1'];
281                                   println 'docker tag 2: ' + project.properties['dockertag2'];
282                               </source>
283                           </configuration>
284                       </execution>
285                   </executions>
286                 </plugin>
287
288                <plugin>
289                     <groupId>io.fabric8</groupId>
290                     <artifactId>docker-maven-plugin</artifactId>
291                     <version>0.28.0</version>  
292                     <configuration>
293                         <verbose>${docker.verbose}</verbose>
294                         <apiVersion>${docker.apiVersion}</apiVersion>
295                         <pullRegistry>${docker.pull.registry}</pullRegistry>
296                         <images>
297                             <image>                            
298                                 <name>${onap.nexus.dockerregistry.daily}/${docker.image}</name>
299                                 <build>
300                                     <cleanup>try</cleanup>
301                                     <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
302                                     <dockerFile>Dockerfile</dockerFile>
303                                     <tags>
304                                         <tag>${dockertag1}</tag>
305                                         <tag>${dockertag2}</tag>
306                                     </tags>
307                                 </build>
308                             </image>
309                         </images>
310                     </configuration>
311                      <executions>
312                          <execution>
313                              <id>generate-images</id>
314                              <phase>install</phase>
315                              <goals>
316                                  <goal>build</goal>
317                              </goals>
318                          </execution>
319                          <execution>
320                              <id>push-images</id>
321                              <phase>deploy</phase>
322                              <goals>
323                                  <goal>push</goal>
324                              </goals>
325                          </execution>
326                      </executions>
327                 </plugin>
328             </plugins>
329         </build>
330     </profile>
331   </profiles>
332   <dependencyManagement>
333     <dependencies>
334       <dependency>
335         <groupId>org.glassfish.jersey</groupId>
336         <artifactId>jersey-bom</artifactId>
337         <version>${jersey.version}</version>
338         <type>pom</type>
339         <scope>import</scope>
340       </dependency>
341     </dependencies>
342   </dependencyManagement>
343   <dependencies>
344     <dependency>
345       <groupId>io.swagger</groupId>
346       <artifactId>swagger-core</artifactId>
347       <version>${swagger.version}</version>
348     </dependency>
349     <dependency>
350       <groupId>io.swagger</groupId>
351       <artifactId>swagger-jersey2-jaxrs</artifactId>
352       <version>${swagger.version}</version>
353     </dependency>
354     <dependency>
355       <groupId>io.swagger</groupId>
356       <artifactId>swagger-annotations</artifactId>
357       <version>${swagger.version}</version>
358     </dependency>
359     <dependency>
360       <groupId>org.glassfish.jersey.containers</groupId>
361       <artifactId>jersey-container-servlet-core</artifactId>
362       <!-- use the following artifactId if you don't need servlet 2.x compatibility -->
363       <!-- artifactId>jersey-container-servlet</artifactId -->
364     </dependency>
365     <dependency>
366       <groupId>org.glassfish.jersey.media</groupId>
367       <artifactId>jersey-media-moxy</artifactId>
368     </dependency>
369     <dependency>
370       <groupId>log4j</groupId>
371       <artifactId>log4j</artifactId>
372       <version>1.2.17</version>
373     </dependency>
374     <dependency>
375       <groupId>org.eclipse.jetty</groupId>
376       <artifactId>jetty-server</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
386     <dependency>
387       <groupId>org.eclipse.jetty</groupId>
388       <artifactId>jetty-servlet</artifactId>
389       <version>${jettyVersion}</version>
390       <scope>compile</scope>
391     </dependency>
392     <dependency>
393       <groupId>org.eclipse.jetty</groupId>
394       <artifactId>jetty-servlets</artifactId>
395       <version>${jettyVersion}</version>
396       <scope>compile</scope>
397     </dependency>
398     <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
399     <dependency>
400       <groupId>com.googlecode.json-simple</groupId>
401       <artifactId>json-simple</artifactId>
402       <version>1.1.1</version>
403     </dependency>
404     <dependency>
405       <groupId>commons-codec</groupId>
406       <artifactId>commons-codec</artifactId>
407       <version>1.11</version>
408     </dependency>
409     <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
410     <dependency>
411       <groupId>org.postgresql</groupId>
412       <artifactId>postgresql</artifactId>
413       <version>42.2.5</version>
414     </dependency>
415
416     <dependency>
417       <groupId>org.onap.dmaap.dbcapi</groupId>
418       <artifactId>dbcapi</artifactId>
419       <version>1.0.23-SNAPSHOT</version>
420     </dependency>
421   </dependencies>
422   <reporting>
423     <plugins>
424       <plugin>
425         <groupId>org.apache.maven.plugins</groupId>
426         <artifactId>maven-javadoc-plugin</artifactId>
427         <version>2.10.4</version>
428         <configuration>
429           <failOnError>false</failOnError>
430           <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
431           <docletArtifact>
432             <groupId>org.umlgraph</groupId>
433             <artifactId>umlgraph</artifactId>
434             <version>5.6</version>
435           </docletArtifact>
436           <additionalparam>-views</additionalparam>
437           <useStandardDocletOptions>true</useStandardDocletOptions>
438         </configuration>
439       </plugin>
440     </plugins>
441   </reporting>
442
443   <distributionManagement>
444     <site>
445       <id>ecomp-site</id>
446       <url>dav:${nexusproxy}${sitePath}</url>
447     </site>
448   </distributionManagement>
449   <properties>
450     <multiproject.basedir>${basedir}/..</multiproject.basedir>
451     <docker.maven.plugin.version>1.0.0</docker.maven.plugin.version>
452     <jersey.version>2.16</jersey.version>
453     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
454     <jettyVersion>9.4.12.RC2</jettyVersion>
455     <eelf.version>1.0.0</eelf.version>
456     <swagger.version>1.5.19</swagger.version>
457     <artifact.version>1.1.1</artifact.version>
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/${artifact.version}</sitePath>
479   </properties>
480   <description>Packaging Platform (DMaaP) Bus Controller API as a Docker container.</description>
481 </project>