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