Add build helper for major/minor versions
[aai/gizmo.git] / 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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23     <modelVersion>4.0.0</modelVersion>
24
25     <parent>
26         <groupId>org.onap.oparent</groupId>
27         <artifactId>oparent</artifactId>
28         <version>2.0.0</version>
29         <relativePath />
30     </parent>
31
32     <groupId>org.onap.aai.gizmo</groupId>
33     <artifactId>gizmo</artifactId>
34     <version>1.6.0-SNAPSHOT</version>
35     <name>aai-gizmo</name>
36
37     <properties>
38         <docker.location>${basedir}/target</docker.location>
39         <version.org.onap.aai.aai-schema-ingest>1.4.1</version.org.onap.aai.aai-schema-ingest>
40         <version.org.onap.aai.aai-schema>1.5.1</version.org.onap.aai.aai-schema>
41         <version.org.onap.aai.aai-utils>1.5.3</version.org.onap.aai.aai-utils>
42         <version.org.onap.aai.aai-auth>1.5.3</version.org.onap.aai.aai-auth>
43         <event.client.version>1.5.0</event.client.version>
44         <!-- Minimum code coverage percentage. Please update this figure as coverage increases to prevent any drops in
45          coverage caused by new changes. Note that this figure cannot be lower than the ONAP requirement of 0.55 -->
46         <jacoco.line.coverage.limit>0.60</jacoco.line.coverage.limit>
47         <jacoco.report.directory>${project.build.directory}/code-coverage</jacoco.report.directory>
48     </properties>
49
50     <dependencyManagement>
51         <dependencies>
52             <dependency>
53                 <!-- Import dependency management from Spring Boot -->
54                 <groupId>org.springframework.boot</groupId>
55                 <artifactId>spring-boot-dependencies</artifactId>
56                 <version>1.5.21.RELEASE</version>
57                 <type>pom</type>
58                 <scope>import</scope>
59             </dependency>
60         </dependencies>
61     </dependencyManagement>
62
63     <dependencies>
64         <dependency>
65             <groupId>org.springframework.boot</groupId>
66             <artifactId>spring-boot-starter-web</artifactId>
67             <exclusions>
68                 <exclusion>
69                     <groupId>org.springframework.boot</groupId>
70                     <artifactId>spring-boot-starter-tomcat</artifactId>
71                 </exclusion>
72             </exclusions>
73         </dependency>
74         <dependency>
75             <groupId>org.springframework.boot</groupId>
76             <artifactId>spring-boot-starter-jetty</artifactId>
77         </dependency>
78         <dependency>
79             <groupId>org.springframework.boot</groupId>
80             <artifactId>spring-boot-starter</artifactId>
81             <exclusions>
82                 <exclusion>
83                     <groupId>ch.qos.logback</groupId>
84                     <artifactId>logback-classic</artifactId>
85                 </exclusion>
86             </exclusions>
87         </dependency>
88         <dependency>
89             <groupId>org.springframework.boot</groupId>
90             <artifactId>spring-boot-starter-jersey</artifactId>
91             <exclusions>
92                 <exclusion>
93                     <groupId>org.springframework.boot</groupId>
94                     <artifactId>spring-boot-starter-tomcat</artifactId>
95                 </exclusion>
96             </exclusions>
97         </dependency>
98         <dependency>
99             <groupId>org.springframework.boot</groupId>
100             <artifactId>spring-boot-starter-actuator</artifactId>
101         </dependency>
102         <dependency>
103             <groupId>org.springframework.boot</groupId>
104             <artifactId>spring-boot-configuration-processor</artifactId>
105             <optional>true</optional>
106         </dependency>
107         <dependency>
108             <groupId>org.springframework.boot</groupId>
109             <artifactId>spring-boot-starter-test</artifactId>
110             <scope>test</scope>
111         </dependency>
112         <dependency>
113             <groupId>org.apache.cxf</groupId>
114             <artifactId>cxf-rt-frontend-jaxrs</artifactId>
115             <version>3.2.5</version>
116         </dependency>
117
118
119      <dependency>
120          <groupId>io.swagger</groupId>
121          <artifactId>swagger-jersey2-jaxrs</artifactId>
122          <version>1.5.8</version>
123       </dependency>
124       <dependency>
125          <groupId>io.springfox</groupId>
126          <artifactId>springfox-swagger2</artifactId>
127          <version>2.9.2</version>
128       </dependency>
129             <dependency>
130          <groupId>io.springfox</groupId>
131          <artifactId>springfox-swagger-ui</artifactId>
132          <version>2.9.2</version>
133       </dependency>
134
135
136         <!-- ONAP AAI-COMMON (incl. model) -->
137         <dependency>
138             <groupId>org.onap.aai.schema-service</groupId>
139             <artifactId>aai-schema</artifactId>
140             <version>${version.org.onap.aai.aai-schema}</version>
141         </dependency>
142         <dependency>
143             <groupId>org.onap.aai.aai-common</groupId>
144             <artifactId>aai-schema-ingest</artifactId>
145             <version>${version.org.onap.aai.aai-schema-ingest}</version>
146             <exclusions>
147                 <exclusion>
148                   <groupId>org.powermock</groupId>
149                   <artifactId>*</artifactId>
150                 </exclusion>
151             </exclusions>
152         </dependency>
153         <dependency>
154             <groupId>org.onap.aai.aai-common</groupId>
155             <artifactId>aai-utils</artifactId>
156             <version>${version.org.onap.aai.aai-utils}</version>
157         </dependency>
158         <dependency>
159             <groupId>org.onap.aai.aai-common</groupId>
160             <artifactId>aai-auth</artifactId>
161             <version>${version.org.onap.aai.aai-auth}</version>
162         </dependency>
163
164         <!-- ONAP EVENT CLIENT -->
165         <dependency>
166             <groupId>org.onap.aai.event-client</groupId>
167             <artifactId>event-client-dmaap</artifactId>
168            <version>${event.client.version}</version>
169             <exclusions>
170                 <exclusion>
171                     <groupId>org.slf4j</groupId>
172                     <artifactId>slf4j-api</artifactId>
173                 </exclusion>
174             </exclusions>
175         </dependency>
176         <dependency>
177             <groupId>org.onap.aai.event-client</groupId>
178             <artifactId>event-client-kafka</artifactId>
179            <version>${event.client.version}</version>
180             <exclusions>
181                 <exclusion>
182                     <groupId>org.slf4j</groupId>
183                     <artifactId>slf4j-api</artifactId>
184                 </exclusion>
185             </exclusions>
186         </dependency>
187
188         <dependency>
189            <groupId>org.onap.aai.event-client</groupId>
190            <artifactId>event-client-rabbitmq</artifactId>
191            <version>${event.client.version}</version>
192             <exclusions>
193                 <exclusion>
194                     <groupId>org.slf4j</groupId>
195                     <artifactId>slf4j-api</artifactId>
196                 </exclusion>
197             </exclusions>
198         </dependency>
199
200         <!-- ONAP COMMON LOGGING -->
201         <dependency>
202             <groupId>org.onap.aai.logging-service</groupId>
203             <artifactId>common-logging</artifactId>
204             <version>1.2.2</version>
205             <exclusions>
206                 <exclusion>
207                     <groupId>ch.qos.logback</groupId>
208                     <artifactId>logback-classic</artifactId>
209                 </exclusion>
210                 <exclusion>
211                     <groupId>ch.qos.logback</groupId>
212                     <artifactId>logback-core</artifactId>
213                 </exclusion>
214                 <exclusion>
215                     <groupId>org.slf4j</groupId>
216                     <artifactId>slf4j-api</artifactId>
217                 </exclusion>
218             </exclusions>
219         </dependency>
220
221         <!-- ONAP REST CLIENT -->
222         <dependency>
223             <groupId>org.onap.aai</groupId>
224             <artifactId>rest-client</artifactId>
225             <version>1.5.0</version>
226         </dependency>
227
228         <dependency>
229             <groupId>ch.qos.logback</groupId>
230             <artifactId>logback-classic</artifactId>
231             <version>1.2.3</version>
232         </dependency>
233         <dependency>
234             <groupId>ch.qos.logback</groupId>
235             <artifactId>logback-core</artifactId>
236             <version>1.2.3</version>
237             <exclusions>
238                 <exclusion>
239                     <groupId>ch.qos.logback</groupId>
240                     <artifactId>logback-classic</artifactId>
241                 </exclusion>
242             </exclusions>
243         </dependency>
244         <dependency>
245             <groupId>ch.qos.logback</groupId>
246             <artifactId>logback-access</artifactId>
247             <version>1.2.3</version>
248         </dependency>
249         <dependency>
250             <groupId>com.google.guava</groupId>
251             <artifactId>guava</artifactId>
252         </dependency>
253         <dependency>
254             <groupId>radeox</groupId>
255             <artifactId>radeox</artifactId>
256             <version>1.0-b2</version>
257         </dependency>
258         <dependency>
259             <groupId>org.codehaus.jackson</groupId>
260             <artifactId>jackson-mapper-asl</artifactId>
261             <version>1.4.5</version>
262         </dependency>
263         <dependency>
264             <groupId>commons-io</groupId>
265             <artifactId>commons-io</artifactId>
266             <version>2.4</version>
267         </dependency>
268         <dependency>
269             <groupId>org.apache.commons</groupId>
270             <artifactId>commons-lang3</artifactId>
271             <version>3.3.1</version>
272         </dependency>
273         <dependency>
274             <groupId>com.google.code.gson</groupId>
275             <artifactId>gson</artifactId>
276             <version>2.6.2</version>
277         </dependency>
278         <dependency>
279             <groupId>org.eclipse.persistence</groupId>
280             <artifactId>eclipselink</artifactId>
281             <version>2.6.2</version>
282         </dependency>
283         <dependency>
284             <groupId>net.dongliu</groupId>
285             <artifactId>gson-java8-datatype</artifactId>
286             <version>1.0.3</version>
287         </dependency>
288         <dependency>
289             <groupId>com.jayway.jsonpath</groupId>
290             <artifactId>json-path</artifactId>
291             <version>2.2.0</version>
292             <exclusions>
293                 <exclusion>
294                     <groupId>org.slf4j</groupId>
295                     <artifactId>slf4j-api</artifactId>
296                 </exclusion>
297             </exclusions>
298         </dependency>
299         <dependency>
300             <groupId>org.apache.tinkerpop</groupId>
301             <artifactId>gremlin-core</artifactId>
302             <version>3.2.3</version>
303             <scope>provided</scope>
304             <exclusions>
305                 <exclusion>
306                     <groupId>org.slf4j</groupId>
307                     <artifactId>slf4j-log4j12</artifactId>
308                 </exclusion>
309                 <exclusion>
310                     <groupId>org.slf4j</groupId>
311                     <artifactId>jcl-over-slf4j</artifactId>
312                 </exclusion>
313                 <exclusion>
314                     <groupId>org.slf4j</groupId>
315                     <artifactId>slf4j-api</artifactId>
316                 </exclusion>
317             </exclusions>
318         </dependency>
319         <dependency>
320             <groupId>org.apache.tinkerpop</groupId>
321             <artifactId>tinkergraph-gremlin</artifactId>
322             <version>3.2.3</version>
323             <scope>provided</scope>
324         </dependency>
325         <dependency>
326             <groupId>org.json</groupId>
327             <artifactId>json</artifactId>
328             <version>20160212</version>
329         </dependency>
330         <dependency>
331             <groupId>org.apache.httpcomponents</groupId>
332             <artifactId>httpclient</artifactId>
333             <version>4.5.3</version>
334         </dependency>
335         <dependency>
336             <groupId>org.apache.httpcomponents</groupId>
337             <artifactId>httpcore</artifactId>
338             <version>4.4.1</version>
339         </dependency>
340
341         <!-- TEST DEPENDENCIES -->
342         <dependency>
343             <groupId>junit</groupId>
344             <artifactId>junit</artifactId>
345         </dependency>
346         <dependency>
347             <groupId>org.skyscreamer</groupId>
348             <artifactId>jsonassert</artifactId>
349             <version>1.5.0</version>
350             <scope>test</scope>
351         </dependency>
352         <dependency>
353             <groupId>org.mockito</groupId>
354             <artifactId>mockito-core</artifactId>
355             <version>2.15.0</version>
356             <scope>test</scope>
357             <exclusions>
358                 <exclusion>
359                     <groupId>org.hamcrest</groupId>
360                     <artifactId>hamcrest-library</artifactId>
361                 </exclusion>
362             </exclusions>
363         </dependency>
364     </dependencies>
365
366     <build>
367         <finalName>${project.artifactId}</finalName>
368         <plugins>
369             <!--
370             Using https://code.revelc.net/formatter-maven-plugin/ for Eclipse formatter
371             Using https://github.com/diffplug/spotless/tree/master/plugin-maven for import order
372             Use in combination to rewrite code and imports, then checkstyle
373
374             mvn formatter:format spotless:apply process-sources
375             -->
376             <plugin>
377                  <groupId>net.revelc.code.formatter</groupId>
378                  <artifactId>formatter-maven-plugin</artifactId>
379                  <version>2.8.1</version>
380                  <configuration>
381                     <configFile>${project.basedir}/onap-java-formatter.xml</configFile>
382                  </configuration>
383                  <!-- https://code.revelc.net/formatter-maven-plugin/
384                       use mvn formatter:format to rewrite source files
385                       use mvn formatter:validate to validate source files -->
386              </plugin>
387             <plugin>
388               <groupId>com.diffplug.spotless</groupId>
389               <artifactId>spotless-maven-plugin</artifactId>
390               <version>1.18.0</version>
391               <configuration>
392                 <java>
393                  <importOrder>
394                    <order>com,java,javax,org</order>
395                  </importOrder>
396                 </java>
397               </configuration>
398             <!-- https://github.com/diffplug/spotless/tree/master/plugin-maven
399                  use mvn spotless:apply to rewrite source files
400                  use mvn spotless:check to validate source files -->
401             </plugin>
402             <plugin>
403                 <groupId>org.apache.maven.plugins</groupId>
404                 <artifactId>maven-resources-plugin</artifactId>
405                 <version>2.7</version>
406                 <executions>
407                     <execution>
408                         <id>copy-docker-file</id>
409                         <phase>package</phase>
410                         <goals>
411                             <goal>copy-resources</goal>
412                         </goals>
413                         <configuration>
414                             <outputDirectory>target</outputDirectory>
415                             <overwrite>true</overwrite>
416                             <resources>
417                                 <resource>
418                                     <directory>${basedir}/src/main/docker</directory>
419                                     <filtering>true</filtering>
420                                     <includes>
421                                         <include>**/*</include>
422                                     </includes>
423                                 </resource>
424                                 <resource>
425                                     <directory>${basedir}</directory>
426                                     <filtering>true</filtering>
427                                     <includes>
428                                         <include>bundleconfig-local/**</include>
429                                     </includes>
430                                 </resource>
431                                 <resource>
432                                     <directory>${basedir}/src/main/bin/</directory>
433                                 </resource>
434                             </resources>
435                         </configuration>
436                     </execution>
437                 </executions>
438             </plugin>
439
440             <plugin>
441                 <groupId>com.spotify</groupId>
442                 <artifactId>docker-maven-plugin</artifactId>
443                 <version>0.4.11</version>
444                 <configuration>
445                     <verbose>true</verbose>
446                     <serverId>docker-hub</serverId>
447                     <imageName>${docker.push.registry}/onap/${project.artifactId}</imageName>
448                     <dockerDirectory>${docker.location}</dockerDirectory>
449                     <imageTags>
450                         <imageTag>latest</imageTag>
451                         <tag>${project.docker.latesttag.version}</tag>
452                         <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
453                     </imageTags>
454                     <forceTags>true</forceTags>
455                 </configuration>
456             </plugin>
457
458             <!-- license plugin -->
459             <!-- Uncomment this to add a license header to every source file -->
460             <plugin>
461                 <groupId>com.mycila</groupId>
462                 <artifactId>license-maven-plugin</artifactId>
463                 <version>3.0</version>
464                 <configuration>
465                     <header>License.txt</header>
466                     <includes>
467                         <include>src/main/java/**</include>
468                         <include>src/test/java/**</include>
469                         <include>pom.xml</include>
470                     </includes>
471                     <skipExistingHeaders>true</skipExistingHeaders>
472                 </configuration>
473                 <executions>
474                     <execution>
475                         <goals>
476                             <!-- Set goal from "check" to "format" to auto update license headers -->
477                             <goal>check</goal>
478                         </goals>
479                         <phase>process-sources</phase>
480                     </execution>
481                 </executions>
482             </plugin>
483
484             <plugin>
485                 <groupId>org.apache.maven.plugins</groupId>
486                 <artifactId>maven-site-plugin</artifactId>
487                 <version>3.3</version>
488                 <configuration>
489                     <reportPlugins>
490                         <plugin>
491                             <groupId>org.apache.maven.plugins</groupId>
492                             <artifactId>maven-checkstyle-plugin</artifactId>
493                             <version>2.17</version>
494                             <reportSets>
495                                 <reportSet>
496                                     <reports>
497                                         <report>checkstyle</report>
498                                     </reports>
499                                 </reportSet>
500                             </reportSets>
501                         </plugin>
502                     </reportPlugins>
503                 </configuration>
504             </plugin>
505             <plugin>
506                 <groupId>org.apache.maven.plugins</groupId>
507                 <artifactId>maven-deploy-plugin</artifactId>
508             </plugin>
509             <plugin>
510                 <groupId>org.springframework.boot</groupId>
511                 <artifactId>spring-boot-maven-plugin</artifactId>
512                 <version>2.0.1.RELEASE</version>
513                 <executions>
514                     <execution>
515                         <goals>
516                             <goal>repackage</goal>
517                         </goals>
518                     </execution>
519                 </executions>
520             </plugin>
521             <plugin>
522                 <groupId>org.apache.maven.plugins</groupId>
523                 <artifactId>maven-dependency-plugin</artifactId>
524                 <executions>
525                     <execution>
526                         <id>unpack</id>
527                         <phase>prepare-package</phase>
528                         <goals>
529                             <goal>unpack</goal>
530                         </goals>
531                         <configuration>
532                             <artifactItems>
533                                 <artifactItem>
534                                     <groupId>org.onap.aai.schema-service</groupId>
535                                     <artifactId>aai-schema</artifactId>
536                                     <version>${version.org.onap.aai.aai-schema}</version>
537                                     <type>jar</type>
538                                     <includes>onap/**/</includes>
539                                     <outputDirectory>${project.build.directory}/bundleconfig-local/etc</outputDirectory>
540                                 </artifactItem>
541                             </artifactItems>
542                         </configuration>
543                     </execution>
544                 </executions>
545             </plugin>
546             <plugin>
547                 <groupId>org.jacoco</groupId>
548                 <artifactId>jacoco-maven-plugin</artifactId>
549                 <executions>
550                     <execution>
551                         <id>default-check</id>
552                         <goals>
553                             <goal>check</goal>
554                         </goals>
555                         <configuration>
556                             <dataFile>${jacoco.report.directory}/jacoco-ut.exec</dataFile>
557                             <rules>
558                                 <!--  implementation is needed only for Maven 2  -->
559                                 <rule implementation="org.jacoco.maven.RuleConfiguration">
560                                     <element>BUNDLE</element>
561                                     <limits>
562                                         <limit implementation="org.jacoco.report.check.Limit">
563                                             <counter>LINE</counter>
564                                             <value>COVEREDRATIO</value>
565                                             <minimum>${jacoco.line.coverage.limit}</minimum>
566                                         </limit>
567                                     </limits>
568                                 </rule>
569                             </rules>
570                         </configuration>
571                     </execution>
572                 </executions>
573             </plugin>
574             <plugin>
575               <groupId>org.codehaus.mojo</groupId>
576               <artifactId>build-helper-maven-plugin</artifactId>
577               <version>3.0.0</version>
578               <executions>
579                 <execution>
580                   <id>parse-version</id>
581                   <goals>
582                     <goal>parse-version</goal>
583                   </goals>
584                 </execution>
585               </executions>
586             </plugin>
587         </plugins>
588     </build>
589     
590     <distributionManagement>
591         <site>
592             <id>ecomp-javadoc</id>
593             <url>dav:https://ecomp-nexus:8443/repository/aai/gizmo-javadoc/${project.version}</url>
594         </site>
595     </distributionManagement>
596 </project>