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