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