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