Fixed project version parsing
[aai/champ.git] / champ-service / pom.xml
1 <!--
2 ============LICENSE_START=======================================================
3 org.onap.aai
4 ================================================================================
5 Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 Copyright © 2017-2018 Amdocs
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 -->
21 <project xmlns="http://maven.apache.org/POM/4.0.0"
22          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24     <modelVersion>4.0.0</modelVersion>
25
26     <parent>
27         <groupId>org.onap.aai</groupId>
28         <artifactId>champ</artifactId>
29         <version>1.6.0-SNAPSHOT</version>
30     </parent>
31
32     <groupId>org.onap.aai.champ</groupId>
33     <artifactId>champ-service</artifactId>
34
35     <properties>
36         <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
37         <common.logging.groupid>org.onap.aai.logging-service</common.logging.groupid>
38         <common.logging.version>1.2.2</common.logging.version>
39
40         <version.org.apache.commons.commons-lang3>3.7</version.org.apache.commons.commons-lang3>
41         <version.org.hamcrest.hamcrest-library>1.3</version.org.hamcrest.hamcrest-library>
42         <version.org.springframework.boot.spring-boot-dependencies>1.5.21.RELEASE</version.org.springframework.boot.spring-boot-dependencies>
43          <!-- Minimum code coverage percentage. Please update this figure as coverage increases to prevent any drops in
44          coverage caused by new changes. Note that this figure cannot be lower than the ONAP requirement of 0.55 -->
45         <jacoco.line.coverage.limit>0.16</jacoco.line.coverage.limit>
46
47         <!-- docker related properties -->
48         <docker.image.name>champ</docker.image.name>
49         <docker.fabric.version>0.28.0</docker.fabric.version>
50         <aai.docker.version>1.0.0</aai.docker.version>
51         <aai.build.directory>${project.build.directory}/${project.artifactId}-build/
52         </aai.build.directory>
53         <aai.docker.namespace>onap</aai.docker.namespace>
54         <aai.base.image>alpine</aai.base.image>
55         <aai.base.image.version>1.6.0</aai.base.image.version>
56         <!-- This will be used for the docker images as the default format of maven build has issues -->
57         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
58     </properties>
59
60     <dependencyManagement>
61         <dependencies>
62             <dependency>
63                 <groupId>org.springframework.boot</groupId>
64                 <artifactId>spring-boot-dependencies</artifactId>
65                 <version>${version.org.springframework.boot.spring-boot-dependencies}</version>
66                 <type>pom</type>
67                 <scope>import</scope>
68             </dependency>
69
70             <dependency>
71                 <groupId>org.apache.httpcomponents</groupId>
72                 <artifactId>httpclient</artifactId>
73                 <version>4.5.3</version>
74             </dependency>
75
76             <dependency>
77                 <groupId>org.apache.httpcomponents</groupId>
78                 <artifactId>httpclient-cache</artifactId>
79                 <version>4.5.3</version>
80             </dependency>
81         </dependencies>
82     </dependencyManagement>
83
84     <dependencies>
85         <dependency>
86             <groupId>org.springframework.boot</groupId>
87             <artifactId>spring-boot-starter-web</artifactId>
88             <exclusions>
89                 <exclusion>
90                     <groupId>org.springframework.boot</groupId>
91                     <artifactId>spring-boot-starter-tomcat</artifactId>
92                 </exclusion>
93                 <exclusion>
94                     <groupId>ch.qos.logback</groupId>
95                     <artifactId>logback-classic</artifactId>
96                 </exclusion>
97             </exclusions>
98         </dependency>
99
100         <dependency>
101             <groupId>org.springframework.boot</groupId>
102             <artifactId>spring-boot-starter-jetty</artifactId>
103         </dependency>
104
105         <dependency>
106             <groupId>org.springframework.boot</groupId>
107             <artifactId>spring-boot-starter-test</artifactId>
108             <scope>test</scope>
109         </dependency>
110         <dependency>
111             <groupId>org.powermock</groupId>
112             <artifactId>powermock-module-junit4</artifactId>
113             <version>1.7.4</version>
114             <scope>test</scope>
115             <exclusions>
116                 <exclusion>
117                     <groupId>org.javassist</groupId>
118                     <artifactId>javassist</artifactId>
119                 </exclusion>
120             </exclusions>
121         </dependency>
122         <dependency>
123             <groupId>org.powermock</groupId>
124             <artifactId>powermock-api-mockito</artifactId>
125             <version>1.7.4</version>
126             <scope>test</scope>
127         </dependency>
128
129         <!-- https://mvnrepository.com/artifact/org.javassist/javassist -->
130         <dependency>
131             <groupId>org.javassist</groupId>
132             <artifactId>javassist</artifactId>
133             <version>3.22.0-GA</version>
134         </dependency>
135
136         <dependency>
137             <groupId>org.springframework.boot</groupId>
138             <artifactId>spring-boot-starter-jersey</artifactId>
139             <exclusions>
140                 <exclusion>
141                     <groupId>org.springframework.boot</groupId>
142                     <artifactId>spring-boot-starter-tomcat</artifactId>
143                 </exclusion>
144             </exclusions>
145         </dependency>
146
147         <dependency>
148             <groupId>org.json</groupId>
149             <artifactId>json</artifactId>
150             <version>20160212</version>
151         </dependency>
152
153         <dependency>
154             <groupId>commons-io</groupId>
155             <artifactId>commons-io</artifactId>
156             <version>2.4</version>
157         </dependency>
158
159         <dependency>
160             <groupId>com.google.code.gson</groupId>
161             <artifactId>gson</artifactId>
162             <version>2.6.2</version>
163         </dependency>
164
165         <dependency>
166             <groupId>com.google.guava</groupId>
167             <artifactId>guava</artifactId>
168         </dependency>
169
170         <dependency>
171             <groupId>${common.logging.groupid}</groupId>
172             <artifactId>common-logging</artifactId>
173             <version>${common.logging.version}</version>
174             <exclusions>
175                 <exclusion>
176                     <groupId>ch.qos.logback</groupId>
177                     <artifactId>logback-classic</artifactId>
178                 </exclusion>
179                 <exclusion>
180                     <groupId>ch.qos.logback</groupId>
181                     <artifactId>logback-core</artifactId>
182                 </exclusion>
183                 <exclusion>
184                     <groupId>org.slf4j</groupId>
185                     <artifactId>slf4j-api</artifactId>
186                 </exclusion>
187             </exclusions>
188         </dependency>
189
190         <dependency>
191             <groupId>org.eclipse.persistence</groupId>
192             <artifactId>eclipselink</artifactId>
193             <version>2.6.2</version>
194         </dependency>
195
196         <dependency>
197             <groupId>org.apache.commons</groupId>
198             <artifactId>commons-lang3</artifactId>
199             <version>3.7</version>
200         </dependency>
201
202         <dependency>
203             <groupId>org.onap.aai.champ.champ-lib</groupId>
204             <artifactId>champ-core</artifactId>
205             <version>${project.version}</version>
206             <scope>compile</scope>
207             <exclusions>
208                 <exclusion>
209                     <groupId>org.apache.hbase</groupId>
210                     <artifactId>hbase-client</artifactId>
211                 </exclusion>
212                 <exclusion>
213                     <groupId>log4j</groupId>
214                     <artifactId>log4j</artifactId>
215                 </exclusion>
216                 <exclusion>
217                     <groupId>log4j</groupId>
218                     <artifactId>apache-log4j-extras</artifactId>
219                 </exclusion>
220                 <exclusion>
221                     <groupId>org.slf4j</groupId>
222                     <artifactId>slf4j-api</artifactId>
223                 </exclusion>
224             </exclusions>
225         </dependency>
226
227         <dependency>
228             <groupId>org.hamcrest</groupId>
229             <artifactId>hamcrest-library</artifactId>
230             <scope>test</scope>
231         </dependency>
232
233         <dependency>
234             <groupId>org.skyscreamer</groupId>
235             <artifactId>jsonassert</artifactId>
236             <version>1.5.0</version>
237             <scope>test</scope>
238         </dependency>
239
240         <dependency>
241             <groupId>ch.qos.logback</groupId>
242             <artifactId>logback-classic</artifactId>
243             <version>1.2.3</version>
244         </dependency>
245
246         <dependency>
247             <groupId>ch.qos.logback</groupId>
248             <artifactId>logback-core</artifactId>
249             <version>1.2.3</version>
250         </dependency>
251
252         <dependency>
253             <groupId>org.onap.dmaap.messagerouter.dmaapclient</groupId>
254             <artifactId>dmaapClient</artifactId>
255             <version>1.1.5</version>
256         </dependency>
257     </dependencies>
258
259     <distributionManagement>
260         <repository>
261             <id>ecomp-releases</id>
262             <name>ECOMP Release Repository</name>
263             <url>${onap.nexus.url}/content/repositories/releases/</url>
264         </repository>
265         <snapshotRepository>
266             <id>ecomp-snapshots</id>
267             <name>ECOMP Snapshot Repository</name>
268             <url>${onap.nexus.url}/content/repositories/snapshots/</url>
269         </snapshotRepository>
270     </distributionManagement>
271
272     <build>
273         <finalName>${project.artifactId}</finalName>
274         <plugins>
275             <plugin>
276                 <groupId>org.springframework.boot</groupId>
277                 <artifactId>spring-boot-maven-plugin</artifactId>
278                 <configuration>
279                     <layout>ZIP</layout>
280                 </configuration>
281                 <executions>
282                     <execution>
283                         <goals>
284                             <goal>repackage</goal>
285                         </goals>
286                     </execution>
287                 </executions>
288             </plugin>
289
290             <plugin>
291                 <artifactId>maven-assembly-plugin</artifactId>
292                 <configuration>
293                     <descriptors>
294                         <descriptor>src/main/assembly/descriptor.xml</descriptor>
295                     </descriptors>
296                 </configuration>
297                 <executions>
298                     <execution>
299                         <id>make-assembly</id>
300                         <phase>package</phase>
301                         <goals>
302                             <goal>single</goal>
303                         </goals>
304                     </execution>
305                 </executions>
306             </plugin>
307
308             <plugin>
309                 <groupId>com.mycila</groupId>
310                 <artifactId>license-maven-plugin</artifactId>
311                 <version>3.0</version>
312                 <configuration>
313                     <header>License.txt</header>
314                     <includes>
315                         <include>src/main/java/**</include>
316                         <include>src/test/java/**</include>
317                         <include>pom.xml</include>
318                     </includes>
319                     <skipExistingHeaders>true</skipExistingHeaders>
320                 </configuration>
321                 <executions>
322                     <execution>
323                         <goals>
324                             <!-- Set goal to "format" to auto update license headers -->
325                             <goal>check</goal>
326                         </goals>
327                         <phase>process-sources</phase>
328                     </execution>
329                 </executions>
330             </plugin>
331             <plugin>
332                 <groupId>org.apache.maven.plugins</groupId>
333                 <artifactId>maven-deploy-plugin</artifactId>
334             </plugin>
335             <plugin>
336                 <groupId>org.apache.maven.plugins</groupId>
337                 <artifactId>maven-site-plugin</artifactId>
338             </plugin>
339         </plugins>
340     </build>
341
342     <profiles>
343         <profile>
344             <id>docker</id>
345             <build>
346                 <plugins>
347                     <plugin>
348                         <groupId>org.codehaus.mojo</groupId>
349                         <artifactId>build-helper-maven-plugin</artifactId>
350                         <version>3.0.0</version>
351                         <executions>
352                             <execution>
353                                 <phase>pre-clean</phase>
354                                 <id>parse-version</id>
355                                 <goals>
356                                     <goal>parse-version</goal>
357                                 </goals>
358                             </execution>
359                         </executions>
360                     </plugin>
361                     <plugin>
362                         <groupId>org.codehaus.groovy.maven</groupId>
363                         <artifactId>gmaven-plugin</artifactId>
364                         <version>1.0</version>
365                         <executions>
366                             <execution>
367                                 <phase>pre-clean</phase>
368                                 <goals>
369                                     <goal>execute</goal>
370                                 </goals>
371                                 <configuration>
372                                     <source>
373                                         def userAaiBaseImage = session.userProperties['aai.base.image']
374                                         def userAaiCommonVersion = session.userProperties['aai.base.image.version']
375                                         if (userAaiCommonVersion != null) {
376                                             project.properties['aai.base.image.version'] = userAaiCommonVersion
377                                         }
378                                         if (userAaiBaseImage != null) {
379                                             project.properties['aai.base.image'] = userAaiBaseImage
380                                         }
381                                         log.info 'Base image flavour: ' + project.properties['aai.base.image']
382                                         log.info 'Base image version: ' + project.properties['aai.base.image.version']
383                                     </source>
384                                 </configuration>
385                             </execution>
386                         </executions>
387                     </plugin>
388                     <plugin>
389                         <groupId>io.fabric8</groupId>
390                         <artifactId>docker-maven-plugin</artifactId>
391                         <version>${docker.fabric.version}</version>
392                         <configuration>
393                             <verbose>true</verbose>
394                             <apiVersion>1.23</apiVersion>
395                             <images>
396                                 <image>
397                                     <name>${docker.push.registry}/${aai.docker.namespace}/${docker.image.name}:%l
398                                     </name>
399                                     <build>
400                                         <filter>@</filter>
401                                         <tags>
402                                             <tag>latest</tag>
403                                             <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
404                                             <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
405                                         </tags>
406                                         <cleanup>try</cleanup>
407                                         <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
408                                         <assembly>
409                                             <inline>
410                                                 <fileSets>
411                                                     <fileSet>
412                                                         <directory>${aai.build.directory}</directory>
413                                                         <outputDirectory>/${project.artifactId}</outputDirectory>
414                                                     </fileSet>
415                                                 </fileSets>
416                                             </inline>
417                                         </assembly>
418                                     </build>
419                                 </image>
420                             </images>
421                         </configuration>
422                         <executions>
423                             <execution>
424                                 <id>clean-images</id>
425                                 <phase>pre-clean</phase>
426                                 <goals>
427                                     <goal>remove</goal>
428                                 </goals>
429                                 <configuration>
430                                     <removeAll>true</removeAll>
431                                 </configuration>
432                             </execution>
433                             <execution>
434                                 <id>generate-images</id>
435                                 <phase>package</phase>
436                                 <goals>
437                                     <goal>build</goal>
438                                 </goals>
439                             </execution>
440                             <execution>
441                                 <id>push-images</id>
442                                 <phase>deploy</phase>
443                                 <goals>
444                                     <goal>push</goal>
445                                 </goals>
446                             </execution>
447                         </executions>
448                     </plugin>
449                 </plugins>
450             </build>
451         </profile>
452     </profiles>
453 </project>