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