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