build mutli-platform images
[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/bin</targetPath>
117                     <directory>${basedir}/misc</directory>
118                         <includes>
119                           <include>dbc-client</include>
120                         </includes>
121                 </resource>
122                  <resource>
123                     <targetPath>${basedir}/target/docker-stage/opt/app/dmaapbc/etc</targetPath>
124                     <directory>${basedir}</directory>
125                         <includes>
126                             <include>version.properties</include>
127                         </includes>
128                 </resource>
129                  <resource>
130                     <targetPath>${basedir}/target/docker-stage/opt/app/dbc-client/misc</targetPath>
131                     <directory>${multiproject.basedir}/misc</directory>
132                         <includes>
133                             <include>cert-client-init.sh</include>
134                         </includes>
135                 </resource>
136               </resources>
137             <plugins>
138
139                 <!-- Copy jar to docker-stage to be included in image -->
140                 <plugin>
141                     <artifactId>maven-resources-plugin</artifactId>
142                     <version>2.7</version>
143                     <executions>
144                        <execution>
145                             <id>copy-jar</id>
146                             <phase>package</phase>
147                             <goals>
148                                 <goal>copy-resources</goal>
149                             </goals>
150                             <configuration>
151                                 <outputDirectory>${basedir}/target/docker-stage/opt/app/dmaapbc/lib</outputDirectory>
152                                 <resources>
153                                     <resource>
154                                         <directory>${multiproject.basedir}/dbc-client/target</directory>
155                                         <includes>
156                                             <include>dbc-client.jar</include>
157                                         </includes>
158                                     </resource>
159                                 </resources>
160                             </configuration>
161                         </execution>
162                     </executions>
163                 </plugin>
164
165                 <!-- Setup image tags per https://wiki.onap.org/display/DW/Independent+Versioning+and+Release+Process#IndependentVersioningandReleaseProcess-StandardizedDockerTagging -->
166                 <plugin>
167                   <groupId>org.codehaus.groovy.maven</groupId>
168                   <artifactId>gmaven-plugin</artifactId>
169                   <executions>
170                       <execution>
171                           <phase>validate</phase>
172                           <goals>
173                               <goal>execute</goal>
174                           </goals>
175                           <configuration>
176                               <properties>
177                                   <ver>${project.version}</ver>
178                                   <timestamp>${maven.build.timestamp}</timestamp>
179                               </properties>
180                               <source>
181                                   println 'ver: ' + project.properties['ver'];
182                                   if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
183                                       project.properties['dockertag1']=project.properties['ver'] + "-latest";
184                                       project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
185                                   } else {
186                                       project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest";
187                                       project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
188                                   }
189                                   println 'docker tag 1: ' + project.properties['dockertag1'];
190                                   println 'docker tag 2: ' + project.properties['dockertag2'];
191                               </source>
192                           </configuration>
193                       </execution>
194                   </executions>
195                 </plugin>
196
197                 <plugin>
198                     <groupId>io.fabric8</groupId>
199                     <artifactId>docker-maven-plugin</artifactId>
200                     <version>0.28.0</version>  
201                     <configuration>
202                         <verbose>${docker.verbose}</verbose>
203                         <apiVersion>${docker.apiVersion}</apiVersion>
204                         <pullRegistry>${docker.pull.registry}</pullRegistry>
205                         <pushRegistry>${docker.push.registry}</pushRegistry>
206                         <images>
207                             <image>                            
208                                 <name>${docker.image}</name>
209                                 <build>
210                                     <cleanup>try</cleanup>
211                                     <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
212                                     <dockerFile>Dockerfile</dockerFile>
213                                     <tags>
214                                         <tag>${dockertag1}</tag>
215                                         <tag>${dockertag2}</tag>
216                                     </tags>
217                                 </build>
218                             </image>
219                         </images>
220                     </configuration>
221                      <executions>
222                          <execution>
223                              <id>generate-images</id>
224                              <phase>install</phase>
225                              <goals>
226                                  <goal>build</goal>
227                              </goals>
228                          </execution>
229                          <execution>
230                              <id>push-images</id>
231                              <phase>deploy</phase>
232                              <goals>
233                                  <goal>push</goal>
234                              </goals>
235                          </execution>
236                      </executions>
237                 </plugin>
238             </plugins>
239         </build>
240     </profile>
241   </profiles>
242   <dependencyManagement>
243   </dependencyManagement>
244
245   <properties>
246     <multiproject.basedir>${basedir}/..</multiproject.basedir>
247     <docker.maven.plugin.version>1.0.0</docker.maven.plugin.version>
248     <jersey.version>2.16</jersey.version>
249     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
250     <jettyVersion>9.4.12.RC2</jettyVersion>
251     <eelf.version>1.0.0</eelf.version>
252     <swagger.version>1.5.19</swagger.version>
253     <artifact.version>1.0.4</artifact.version>
254     <!--  SONAR  -->
255     <jacoco.version>0.7.7.201606060606</jacoco.version>
256     <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
257     <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
258     <!-- Default Sonar configuration -->
259     <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
260     <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
261     <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
262     <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
263
264     <!-- docker image -->
265     <docker.image>onap/dmaap/dbc-client</docker.image>
266
267     <nexusproxy>https://nexus.onap.org</nexusproxy>
268     <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
269
270     <!-- for Distribution Management -->
271     <sitePath>/content/sites/site/org/onap/dmaap/dbc-client/${artifact.version}</sitePath>
272
273     <timestamp>${maven.build.timestamp}</timestamp>
274     <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
275
276   </properties>
277   <description>Packaging Platform (DMaaP) HTTP Client for Bus Controller Provisioning.</description>
278 </project>