f7f2bc154b14bde9127e8f042fac1b8de74dec7c
[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         <plugins>
180           <plugin>
181             <groupId>com.spotify</groupId>
182             <artifactId>docker-maven-plugin</artifactId>
183             <version>${docker.maven.plugin.version}</version>
184             <configuration>
185               <baseImage>java:openjdk-8-jre</baseImage>
186               <imageName>${onap.nexus.dockerregistry.daily}/${docker.image}</imageName>
187               <entryPoint>["./bin/dmaapbc", "deploy"]</entryPoint>
188               <serverId>${onap.nexus.dockerregistry.daily}</serverId>
189               <skipDockerBuild>false</skipDockerBuild>
190               <imageTags>
191                 <imageTag>${artifact.version}</imageTag>
192                 <imageTag>latest</imageTag>
193               </imageTags>
194               <volumes>
195                 <volume>/opt/app/dmaapbc/log</volume>
196               </volumes>
197               <forceTags>true</forceTags>
198               <user>root</user>
199               <resources>
200                 <resource>
201                   <targetPath>/opt/app/dmaapbc/lib</targetPath>
202                   <directory>${multiproject.basedir}/dmaap-bc/target</directory>
203                   <include>dmaap-bc.jar</include>
204                 </resource>
205                 <resource>
206                   <targetPath>/opt/app/dmaapbc/etc</targetPath>
207                   <directory>${multiproject.basedir}/dmaap-bc/misc</directory>
208                   <include>LocalKey</include>
209                   <include>logback.xml</include>
210                   <include>org.onap.dmaap-bc.trust.jks</include>
211                   <include>dbc-api.jks</include>
212                 </resource>
213                 <resource>
214                   <targetPath>/opt/app/dmaapbc/etc</targetPath>
215                   <directory>${multiproject.basedir}/dmaap-bc</directory>
216                   <include>version.properties</include>
217                 </resource>
218                 <resource>
219                   <targetPath>/opt/app/dmaapbc/misc</targetPath>
220                   <directory>${multiproject.basedir}/dmaap-bc/misc</directory>
221                   <include>opensource.env</include>
222                   <include>*.tmpl</include>
223                 </resource>
224                 <resource>
225                   <targetPath>/opt/app/dmaapbc/misc</targetPath>
226                   <directory>${multiproject.basedir}/misc</directory>
227                   <include>cert-client-init.sh</include>
228                 </resource>
229                 <resource>
230                   <targetPath>/opt/app/dmaapbc/bin</targetPath>
231                   <directory>${multiproject.basedir}/dmaap-bc/misc</directory>
232                   <include>dmaapbc</include>
233                   <include>doaction</include>
234                 </resource>
235               </resources>
236               <runs>
237                 <run>mv /opt/app/dmaapbc/etc/dbc-api.jks /opt/app/dmaapbc/etc/keystore</run>
238                 <run>chmod 600 /opt/app/dmaapbc/etc/keystore</run>
239                 <run>chmod 600 /opt/app/dmaapbc/etc/org.onap.dmaap-bc.trust.jks</run>
240                 <run>chmod +x /opt/app/dmaapbc/misc/cert-client-init.sh</run>
241                 <run>chmod +x /opt/app/dmaapbc/bin/*</run>
242                 <run>mkdir /opt/app/dmaapbc/logs</run>
243                 <run>mkdir /opt/app/dmaapbc/www</run>
244                 <run>mkdir /opt/app/dmaapbc/www/doc</run>
245               </runs>
246               <workdir>/opt/app/dmaapbc</workdir>
247             </configuration>
248             <executions>
249              <execution>
250                  <id>default</id>
251                  <goals>
252                       <goal>build</goal>
253                       <goal>push</goal>
254                   </goals>
255              </execution>
256          </executions>
257           </plugin>
258         </plugins>
259       </build>
260     </profile>
261   </profiles>
262   <dependencyManagement>
263     <dependencies>
264       <dependency>
265         <groupId>org.glassfish.jersey</groupId>
266         <artifactId>jersey-bom</artifactId>
267         <version>${jersey.version}</version>
268         <type>pom</type>
269         <scope>import</scope>
270       </dependency>
271     </dependencies>
272   </dependencyManagement>
273   <dependencies>
274     <dependency>
275       <groupId>io.swagger</groupId>
276       <artifactId>swagger-core</artifactId>
277       <version>${swagger.version}</version>
278     </dependency>
279     <dependency>
280       <groupId>io.swagger</groupId>
281       <artifactId>swagger-jersey2-jaxrs</artifactId>
282       <version>${swagger.version}</version>
283     </dependency>
284     <dependency>
285       <groupId>io.swagger</groupId>
286       <artifactId>swagger-annotations</artifactId>
287       <version>${swagger.version}</version>
288     </dependency>
289     <dependency>
290       <groupId>org.glassfish.jersey.containers</groupId>
291       <artifactId>jersey-container-servlet-core</artifactId>
292       <!-- use the following artifactId if you don't need servlet 2.x compatibility -->
293       <!-- artifactId>jersey-container-servlet</artifactId -->
294     </dependency>
295     <dependency>
296       <groupId>org.glassfish.jersey.media</groupId>
297       <artifactId>jersey-media-moxy</artifactId>
298     </dependency>
299     <dependency>
300       <groupId>log4j</groupId>
301       <artifactId>log4j</artifactId>
302       <version>1.2.17</version>
303     </dependency>
304     <dependency>
305       <groupId>org.eclipse.jetty</groupId>
306       <artifactId>jetty-server</artifactId>
307       <version>${jettyVersion}</version>
308     </dependency>
309     <dependency>
310       <groupId>org.onap.aaf.authz</groupId>
311       <artifactId>aaf-cadi-aaf</artifactId>
312       <version>2.1.7</version>
313       <classifier>full</classifier>
314     </dependency>
315
316     <dependency>
317       <groupId>org.eclipse.jetty</groupId>
318       <artifactId>jetty-servlet</artifactId>
319       <version>${jettyVersion}</version>
320       <scope>compile</scope>
321     </dependency>
322     <dependency>
323       <groupId>org.eclipse.jetty</groupId>
324       <artifactId>jetty-servlets</artifactId>
325       <version>${jettyVersion}</version>
326       <scope>compile</scope>
327     </dependency>
328     <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
329     <dependency>
330       <groupId>com.googlecode.json-simple</groupId>
331       <artifactId>json-simple</artifactId>
332       <version>1.1.1</version>
333     </dependency>
334     <dependency>
335       <groupId>commons-codec</groupId>
336       <artifactId>commons-codec</artifactId>
337       <version>1.11</version>
338     </dependency>
339     <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
340     <dependency>
341       <groupId>org.postgresql</groupId>
342       <artifactId>postgresql</artifactId>
343       <version>42.2.5</version>
344     </dependency>
345
346     <dependency>
347       <groupId>org.onap.dmaap.dbcapi</groupId>
348       <artifactId>dbcapi</artifactId>
349       <version>1.0.23-SNAPSHOT</version>
350     </dependency>
351   </dependencies>
352   <reporting>
353     <plugins>
354       <plugin>
355         <groupId>org.apache.maven.plugins</groupId>
356         <artifactId>maven-javadoc-plugin</artifactId>
357         <version>2.10.4</version>
358         <configuration>
359           <failOnError>false</failOnError>
360           <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
361           <docletArtifact>
362             <groupId>org.umlgraph</groupId>
363             <artifactId>umlgraph</artifactId>
364             <version>5.6</version>
365           </docletArtifact>
366           <additionalparam>-views</additionalparam>
367           <useStandardDocletOptions>true</useStandardDocletOptions>
368         </configuration>
369       </plugin>
370     </plugins>
371   </reporting>
372
373   <distributionManagement>
374     <site>
375       <id>ecomp-site</id>
376       <url>dav:${nexusproxy}${sitePath}</url>
377     </site>
378   </distributionManagement>
379   <properties>
380     <multiproject.basedir>${basedir}/..</multiproject.basedir>
381     <docker.maven.plugin.version>1.0.0</docker.maven.plugin.version>
382     <jersey.version>2.16</jersey.version>
383     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
384     <jettyVersion>9.4.12.RC2</jettyVersion>
385     <eelf.version>1.0.0</eelf.version>
386     <swagger.version>1.5.19</swagger.version>
387     <artifact.version>1.1.1</artifact.version>
388     <!--  SONAR  -->
389     <jacoco.version>0.7.7.201606060606</jacoco.version>
390     <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
391     <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
392     <!-- Default Sonar configuration -->
393     <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
394     <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
395     <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
396     <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
397
398     <!-- docker image -->
399     <docker.image>onap/dmaap/dmaap-bc</docker.image>
400
401     <nexusproxy>https://nexus.onap.org</nexusproxy>
402     <docker.push.registry>10.12.5.45:5000</docker.push.registry>
403
404     <!-- for Distribution Management -->
405     <sitePath>/content/sites/site/org/onap/dmaap/dmaap-bc/${artifact.version}</sitePath>
406   </properties>
407   <description>Packaging Platform (DMaaP) Bus Controller API as a Docker container.</description>
408 </project>