384d6a81d9e42fd83125ea51c179d12847f9ca9c
[dmaap/buscontroller.git] / dbc-client / 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>dbc-client</artifactId>
27   <version>${artifact.version}</version>
28   <name>dbc-client</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>dbc-client</finalName>
37
38     <plugins>
39
40
41       <plugin>
42         <groupId>org.sonatype.plugins</groupId>
43         <artifactId>nexus-staging-maven-plugin</artifactId>
44         <extensions>true</extensions>
45         <configuration>
46           <serverId>ecomp-staging</serverId>
47           <nexusUrl>${nexusproxy}</nexusUrl>
48           <stagingProfileId>176c31dfe190a</stagingProfileId>
49         </configuration>
50       </plugin>
51
52       <!-- for Distribution management -->
53       <plugin>
54         <groupId>org.apache.maven.plugins</groupId>
55         <artifactId>maven-site-plugin</artifactId>
56         <dependencies>
57           <dependency>
58             <groupId>org.apache.maven.wagon</groupId>
59             <artifactId>wagon-webdav-jackrabbit</artifactId>
60             <version>2.10</version>
61           </dependency>
62         </dependencies>
63       </plugin>
64
65     </plugins>
66     <pluginManagement>
67       <plugins>
68         <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
69         <plugin>
70           <groupId>org.eclipse.m2e</groupId>
71           <artifactId>lifecycle-mapping</artifactId>
72           <version>1.0.0</version>
73           <configuration>
74             <lifecycleMappingMetadata>
75               <pluginExecutions>
76                 <pluginExecution>
77                   <pluginExecutionFilter>
78                     <groupId>org.apache.maven.plugins</groupId>
79                     <artifactId>maven-dependency-plugin</artifactId>
80                     <versionRange>[2.10,)</versionRange>
81                     <phase>install</phase>
82                     <goals>
83                       <goal>copy-dependencies</goal>
84                     </goals>
85                   </pluginExecutionFilter>
86                   <action>
87                     <ignore/>
88                   </action>
89                 </pluginExecution>
90               </pluginExecutions>
91             </lifecycleMappingMetadata>
92           </configuration>
93         </plugin>
94       </plugins>
95     </pluginManagement>
96   </build>
97   <profiles>
98       <profile>
99         <id>docker</id>
100         <properties>
101             <skipDockerBuild>false</skipDockerBuild>
102             <skipDockerTag>false</skipDockerTag>
103             <skipTests>true</skipTests>
104         </properties>
105         <build>
106             <!-- Copy files to docker-stage to be included in image -->        
107             <resources>
108                 <resource>
109                     <targetPath>${basedir}/target/docker-stage</targetPath>
110                     <directory>${basedir}/src/main/resources</directory>
111                         <includes>
112                             <include>Dockerfile</include>
113                         </includes>
114                 </resource>
115                  <resource>
116                     <targetPath>${basedir}/target/docker-stage/opt/app/dbc-client/etc</targetPath>
117                     <directory>${multiproject.basedir}/certs</directory>
118                         <includes>
119                           <include>org.onap.dmaap-bc.cred.props</include>
120                           <include>org.onap.dmaap-bc.crontab.sh</include>
121                           <include>org.onap.dmaap-bc.jks</include>
122                           <include>org.onap.dmaap-bc.keyfile</include>
123                           <include>org.onap.dmaap-bc.location.props</include>
124                           <include>org.onap.dmaap-bc.p12</include>
125                           <include>org.onap.dmaap-bc.props</include>
126                           <include>org.onap.dmaap-bc.showpass</include>
127                           <include>org.onap.dmaap-bc.trust.jks</include>
128                           <include>ca.pem</include>
129                           <include>client.pem</include>
130                           <include>key.pem</include>
131                         </includes>
132                 </resource>
133
134                  <resource>
135                     <targetPath>${basedir}/target/docker-stage/opt/app/dbc-client/bin</targetPath>
136                     <directory>${basedir}/misc</directory>
137                         <includes>
138                           <include>dbc-client</include>
139                         </includes>
140                 </resource>
141                  <resource>
142                     <targetPath>${basedir}/target/docker-stage/opt/app/dbc-client/etc</targetPath>
143                     <directory>${basedir}</directory>
144                         <includes>
145                             <include>version.properties</include>
146                         </includes>
147                 </resource>
148                  <resource>
149                     <targetPath>${basedir}/target/docker-stage/opt/app/dbc-client/misc</targetPath>
150                     <directory>${multiproject.basedir}/misc</directory>
151                         <includes>
152                             <include>cert-client-init.sh</include>
153                             <include>aaf-ca.crt</include>
154                         </includes>
155                 </resource>
156               </resources>
157             <plugins>
158
159                 <!-- Copy jar to docker-stage to be included in image -->
160                 <plugin>
161                     <artifactId>maven-resources-plugin</artifactId>
162                     <version>2.7</version>
163                     <executions>
164                        <execution>
165                             <id>copy-jar</id>
166                             <phase>package</phase>
167                             <goals>
168                                 <goal>copy-resources</goal>
169                             </goals>
170                             <configuration>
171                                 <outputDirectory>${basedir}/target/docker-stage/opt/app/dmaapbc/lib</outputDirectory>
172                                 <resources>
173                                     <resource>
174                                         <directory>${multiproject.basedir}/dbc-client/target</directory>
175                                         <includes>
176                                             <include>dbc-client.jar</include>
177                                         </includes>
178                                     </resource>
179                                 </resources>
180                             </configuration>
181                         </execution>
182                     </executions>
183                 </plugin>
184
185                 <!-- Setup image tags per https://wiki.onap.org/display/DW/Independent+Versioning+and+Release+Process#IndependentVersioningandReleaseProcess-StandardizedDockerTagging -->
186                 <plugin>
187                   <groupId>org.codehaus.groovy.maven</groupId>
188                   <artifactId>gmaven-plugin</artifactId>
189                   <executions>
190                       <execution>
191                           <phase>validate</phase>
192                           <goals>
193                               <goal>execute</goal>
194                           </goals>
195                           <configuration>
196                               <properties>
197                                   <ver>${project.version}</ver>
198                                   <timestamp>${maven.build.timestamp}</timestamp>
199                               </properties>
200                               <source>
201                                   println 'ver: ' + project.properties['ver'];
202                                   if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
203                                       project.properties['dockertag1']=project.properties['ver'] + "-latest";
204                                       project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
205                                   } else {
206                                       project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest";
207                                       project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
208                                   }
209                                   println 'docker tag 1: ' + project.properties['dockertag1'];
210                                   println 'docker tag 2: ' + project.properties['dockertag2'];
211                               </source>
212                           </configuration>
213                       </execution>
214                   </executions>
215                 </plugin>
216
217                 <plugin>
218                     <groupId>io.fabric8</groupId>
219                     <artifactId>docker-maven-plugin</artifactId>
220                     <version>0.28.0</version>  
221                     <configuration>
222                         <verbose>${docker.verbose}</verbose>
223                         <apiVersion>${docker.apiVersion}</apiVersion>
224                         <pullRegistry>${docker.pull.registry}</pullRegistry>
225                         <pushRegistry>${docker.push.registry}</pushRegistry>
226                         <images>
227                             <image>                            
228                                 <name>${docker.image}</name>
229                                 <build>
230                                     <cleanup>try</cleanup>
231                                     <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
232                                     <dockerFile>Dockerfile</dockerFile>
233                                     <tags>
234                                         <tag>${dockertag1}</tag>
235                                         <tag>${dockertag2}</tag>
236                                     </tags>
237                                 </build>
238                             </image>
239                         </images>
240                     </configuration>
241                      <executions>
242                          <execution>
243                              <id>generate-images</id>
244                              <phase>install</phase>
245                              <goals>
246                                  <goal>build</goal>
247                              </goals>
248                          </execution>
249                          <execution>
250                              <id>push-images</id>
251                              <phase>deploy</phase>
252                              <goals>
253                                  <goal>push</goal>
254                              </goals>
255                          </execution>
256                      </executions>
257                 </plugin>
258             </plugins>
259         </build>
260     </profile>
261   </profiles>
262   <dependencyManagement>
263   </dependencyManagement>
264
265   <properties>
266     <multiproject.basedir>${basedir}/..</multiproject.basedir>
267     <docker.maven.plugin.version>1.0.0</docker.maven.plugin.version>
268     <jersey.version>2.16</jersey.version>
269     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
270     <jettyVersion>9.4.12.RC2</jettyVersion>
271     <eelf.version>1.0.0</eelf.version>
272     <swagger.version>1.5.19</swagger.version>
273     <artifact.version>1.0.7</artifact.version>
274     <!--  SONAR  -->
275     <jacoco.version>0.7.7.201606060606</jacoco.version>
276     <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
277     <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
278     <!-- Default Sonar configuration -->
279     <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
280     <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
281     <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
282     <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
283
284     <!-- docker image -->
285     <docker.image>onap/dmaap/dbc-client</docker.image>
286
287     <nexusproxy>https://nexus.onap.org</nexusproxy>
288     <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
289
290     <!-- for Distribution Management -->
291     <sitePath>/content/sites/site/org/onap/dmaap/dbc-client/${artifact.version}</sitePath>
292
293     <timestamp>${maven.build.timestamp}</timestamp>
294     <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
295
296   </properties>
297   <description>Packaging Platform (DMaaP) HTTP Client for Bus Controller Provisioning.</description>
298 </project>