60987b1b0036341cbbba6c94f1db25c57262d61d
[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         <!-- docker related properties -->
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                 <!-- Import dependency management from Spring Boot -->
64                 <groupId>org.springframework.boot</groupId>
65                 <artifactId>spring-boot-dependencies</artifactId>
66                 <version>1.5.21.RELEASE</version>
67                 <type>pom</type>
68                 <scope>import</scope>
69             </dependency>
70         </dependencies>
71     </dependencyManagement>
72
73     <dependencies>
74         <dependency>
75             <groupId>org.springframework.boot</groupId>
76             <artifactId>spring-boot-starter-web</artifactId>
77             <exclusions>
78                 <exclusion>
79                     <groupId>org.springframework.boot</groupId>
80                     <artifactId>spring-boot-starter-tomcat</artifactId>
81                 </exclusion>
82             </exclusions>
83         </dependency>
84         <dependency>
85             <groupId>org.springframework.boot</groupId>
86             <artifactId>spring-boot-starter-jetty</artifactId>
87         </dependency>
88         <dependency>
89             <groupId>org.springframework.boot</groupId>
90             <artifactId>spring-boot-starter</artifactId>
91             <exclusions>
92                 <exclusion>
93                     <groupId>ch.qos.logback</groupId>
94                     <artifactId>logback-classic</artifactId>
95                 </exclusion>
96             </exclusions>
97         </dependency>
98         <dependency>
99             <groupId>org.springframework.boot</groupId>
100             <artifactId>spring-boot-starter-jersey</artifactId>
101             <exclusions>
102                 <exclusion>
103                     <groupId>org.springframework.boot</groupId>
104                     <artifactId>spring-boot-starter-tomcat</artifactId>
105                 </exclusion>
106             </exclusions>
107         </dependency>
108         <dependency>
109             <groupId>org.springframework.boot</groupId>
110             <artifactId>spring-boot-starter-actuator</artifactId>
111         </dependency>
112         <dependency>
113             <groupId>org.springframework.boot</groupId>
114             <artifactId>spring-boot-configuration-processor</artifactId>
115             <optional>true</optional>
116         </dependency>
117         <dependency>
118             <groupId>org.springframework.boot</groupId>
119             <artifactId>spring-boot-starter-test</artifactId>
120             <scope>test</scope>
121         </dependency>
122         <dependency>
123             <groupId>org.apache.cxf</groupId>
124             <artifactId>cxf-rt-frontend-jaxrs</artifactId>
125             <version>3.2.5</version>
126         </dependency>
127
128
129         <dependency>
130             <groupId>io.swagger</groupId>
131             <artifactId>swagger-jersey2-jaxrs</artifactId>
132             <version>1.5.8</version>
133         </dependency>
134         <dependency>
135             <groupId>io.springfox</groupId>
136             <artifactId>springfox-swagger2</artifactId>
137             <version>2.9.2</version>
138         </dependency>
139         <dependency>
140             <groupId>io.springfox</groupId>
141             <artifactId>springfox-swagger-ui</artifactId>
142             <version>2.9.2</version>
143         </dependency>
144
145
146         <!-- ONAP AAI-COMMON (incl. model) -->
147         <dependency>
148             <groupId>org.onap.aai.schema-service</groupId>
149             <artifactId>aai-schema</artifactId>
150             <version>${version.org.onap.aai.aai-schema}</version>
151         </dependency>
152         <dependency>
153             <groupId>org.onap.aai.aai-common</groupId>
154             <artifactId>aai-schema-ingest</artifactId>
155             <version>${version.org.onap.aai.aai-schema-ingest}</version>
156             <exclusions>
157                 <exclusion>
158                     <groupId>org.powermock</groupId>
159                     <artifactId>*</artifactId>
160                 </exclusion>
161             </exclusions>
162         </dependency>
163         <dependency>
164             <groupId>org.onap.aai.aai-common</groupId>
165             <artifactId>aai-utils</artifactId>
166             <version>${version.org.onap.aai.aai-utils}</version>
167         </dependency>
168         <dependency>
169             <groupId>org.onap.aai.aai-common</groupId>
170             <artifactId>aai-auth</artifactId>
171             <version>${version.org.onap.aai.aai-auth}</version>
172         </dependency>
173
174         <!-- ONAP EVENT CLIENT -->
175         <dependency>
176             <groupId>org.onap.aai.event-client</groupId>
177             <artifactId>event-client-dmaap</artifactId>
178             <version>${event.client.version}</version>
179             <exclusions>
180                 <exclusion>
181                     <groupId>org.slf4j</groupId>
182                     <artifactId>slf4j-api</artifactId>
183                 </exclusion>
184             </exclusions>
185         </dependency>
186         <dependency>
187             <groupId>org.onap.aai.event-client</groupId>
188             <artifactId>event-client-kafka</artifactId>
189             <version>${event.client.version}</version>
190             <exclusions>
191                 <exclusion>
192                     <groupId>org.slf4j</groupId>
193                     <artifactId>slf4j-api</artifactId>
194                 </exclusion>
195             </exclusions>
196         </dependency>
197
198         <dependency>
199             <groupId>org.onap.aai.event-client</groupId>
200             <artifactId>event-client-rabbitmq</artifactId>
201             <version>${event.client.version}</version>
202             <exclusions>
203                 <exclusion>
204                     <groupId>org.slf4j</groupId>
205                     <artifactId>slf4j-api</artifactId>
206                 </exclusion>
207             </exclusions>
208         </dependency>
209
210         <!-- ONAP COMMON LOGGING -->
211         <dependency>
212             <groupId>org.onap.aai.logging-service</groupId>
213             <artifactId>common-logging</artifactId>
214             <version>1.2.2</version>
215             <exclusions>
216                 <exclusion>
217                     <groupId>ch.qos.logback</groupId>
218                     <artifactId>logback-classic</artifactId>
219                 </exclusion>
220                 <exclusion>
221                     <groupId>ch.qos.logback</groupId>
222                     <artifactId>logback-core</artifactId>
223                 </exclusion>
224                 <exclusion>
225                     <groupId>org.slf4j</groupId>
226                     <artifactId>slf4j-api</artifactId>
227                 </exclusion>
228             </exclusions>
229         </dependency>
230
231         <!-- ONAP REST CLIENT -->
232         <dependency>
233             <groupId>org.onap.aai</groupId>
234             <artifactId>rest-client</artifactId>
235             <version>1.5.0</version>
236         </dependency>
237
238         <dependency>
239             <groupId>ch.qos.logback</groupId>
240             <artifactId>logback-classic</artifactId>
241             <version>1.2.3</version>
242         </dependency>
243         <dependency>
244             <groupId>ch.qos.logback</groupId>
245             <artifactId>logback-core</artifactId>
246             <version>1.2.3</version>
247             <exclusions>
248                 <exclusion>
249                     <groupId>ch.qos.logback</groupId>
250                     <artifactId>logback-classic</artifactId>
251                 </exclusion>
252             </exclusions>
253         </dependency>
254         <dependency>
255             <groupId>ch.qos.logback</groupId>
256             <artifactId>logback-access</artifactId>
257             <version>1.2.3</version>
258         </dependency>
259         <dependency>
260             <groupId>com.google.guava</groupId>
261             <artifactId>guava</artifactId>
262         </dependency>
263         <dependency>
264             <groupId>radeox</groupId>
265             <artifactId>radeox</artifactId>
266             <version>1.0-b2</version>
267         </dependency>
268         <dependency>
269             <groupId>org.codehaus.jackson</groupId>
270             <artifactId>jackson-mapper-asl</artifactId>
271             <version>1.4.5</version>
272         </dependency>
273         <dependency>
274             <groupId>commons-io</groupId>
275             <artifactId>commons-io</artifactId>
276             <version>2.4</version>
277         </dependency>
278         <dependency>
279             <groupId>org.apache.commons</groupId>
280             <artifactId>commons-lang3</artifactId>
281             <version>3.3.1</version>
282         </dependency>
283         <dependency>
284             <groupId>com.google.code.gson</groupId>
285             <artifactId>gson</artifactId>
286             <version>2.6.2</version>
287         </dependency>
288         <dependency>
289             <groupId>org.eclipse.persistence</groupId>
290             <artifactId>eclipselink</artifactId>
291             <version>2.6.2</version>
292         </dependency>
293         <dependency>
294             <groupId>net.dongliu</groupId>
295             <artifactId>gson-java8-datatype</artifactId>
296             <version>1.0.3</version>
297         </dependency>
298         <dependency>
299             <groupId>com.jayway.jsonpath</groupId>
300             <artifactId>json-path</artifactId>
301             <version>2.2.0</version>
302             <exclusions>
303                 <exclusion>
304                     <groupId>org.slf4j</groupId>
305                     <artifactId>slf4j-api</artifactId>
306                 </exclusion>
307             </exclusions>
308         </dependency>
309         <dependency>
310             <groupId>org.apache.tinkerpop</groupId>
311             <artifactId>gremlin-core</artifactId>
312             <version>3.2.3</version>
313             <scope>provided</scope>
314             <exclusions>
315                 <exclusion>
316                     <groupId>org.slf4j</groupId>
317                     <artifactId>slf4j-log4j12</artifactId>
318                 </exclusion>
319                 <exclusion>
320                     <groupId>org.slf4j</groupId>
321                     <artifactId>jcl-over-slf4j</artifactId>
322                 </exclusion>
323                 <exclusion>
324                     <groupId>org.slf4j</groupId>
325                     <artifactId>slf4j-api</artifactId>
326                 </exclusion>
327             </exclusions>
328         </dependency>
329         <dependency>
330             <groupId>org.apache.tinkerpop</groupId>
331             <artifactId>tinkergraph-gremlin</artifactId>
332             <version>3.2.3</version>
333             <scope>provided</scope>
334         </dependency>
335         <dependency>
336             <groupId>org.json</groupId>
337             <artifactId>json</artifactId>
338             <version>20160212</version>
339         </dependency>
340         <dependency>
341             <groupId>org.apache.httpcomponents</groupId>
342             <artifactId>httpclient</artifactId>
343             <version>4.5.3</version>
344         </dependency>
345         <dependency>
346             <groupId>org.apache.httpcomponents</groupId>
347             <artifactId>httpcore</artifactId>
348             <version>4.4.1</version>
349         </dependency>
350
351         <!-- TEST DEPENDENCIES -->
352         <dependency>
353             <groupId>junit</groupId>
354             <artifactId>junit</artifactId>
355         </dependency>
356         <dependency>
357             <groupId>org.skyscreamer</groupId>
358             <artifactId>jsonassert</artifactId>
359             <version>1.5.0</version>
360             <scope>test</scope>
361         </dependency>
362         <dependency>
363             <groupId>org.mockito</groupId>
364             <artifactId>mockito-core</artifactId>
365             <version>2.15.0</version>
366             <scope>test</scope>
367             <exclusions>
368                 <exclusion>
369                     <groupId>org.hamcrest</groupId>
370                     <artifactId>hamcrest-library</artifactId>
371                 </exclusion>
372             </exclusions>
373         </dependency>
374     </dependencies>
375
376     <profiles>
377         <!-- Docker profile to be used for building docker image and pushing to nexus -->
378         <profile>
379             <id>docker</id>
380             <build>
381                 <plugins>
382
383                     <plugin>
384                         <groupId>io.fabric8</groupId>
385                         <artifactId>docker-maven-plugin</artifactId>
386                         <version>${docker.fabric.version}</version>
387                         <configuration>
388                             <verbose>true</verbose>
389                             <apiVersion>1.23</apiVersion>
390                             <images>
391                                 <image>
392                                     <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l
393                                     </name>
394                                     <build>
395                                         <filter>@</filter>
396                                         <tags>
397                                             <tag>latest</tag>
398                                             <tag>${project.docker.latesttag.version}</tag>
399                                             <tag>${project.major.version}.${project.minor.version}-STAGING-${maven.build.timestamp}</tag>
400                                         </tags>
401                                         <cleanup>try</cleanup>
402                                         <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
403                                         <assembly>
404                                             <inline>
405                                                 <fileSets>
406                                                     <fileSet>
407                                                         <directory>${aai.build.directory}</directory>
408                                                         <outputDirectory>/${project.artifactId}</outputDirectory>
409                                                     </fileSet>
410                                                 </fileSets>
411                                             </inline>
412                                         </assembly>
413                                     </build>
414                                 </image>
415                             </images>
416                         </configuration>
417                         <executions>
418                             <execution>
419                                 <id>clean-images</id>
420                                 <phase>pre-clean</phase>
421                                 <goals>
422                                     <goal>remove</goal>
423                                 </goals>
424                                 <configuration>
425                                     <removeAll>true</removeAll>
426                                 </configuration>
427                             </execution>
428                             <execution>
429                                 <id>generate-images</id>
430                                 <phase>package</phase>
431                                 <goals>
432                                     <goal>build</goal>
433                                 </goals>
434                             </execution>
435                             <execution>
436                                 <id>push-images</id>
437                                 <phase>deploy</phase>
438                                 <goals>
439                                     <goal>push</goal>
440                                 </goals>
441                             </execution>
442                         </executions>
443                     </plugin>
444                     <plugin>
445                       <groupId>org.codehaus.mojo</groupId>
446                       <artifactId>build-helper-maven-plugin</artifactId>
447                       <version>3.0.0</version>
448                       <executions>
449                         <execution>
450                           <id>parse-version</id>
451                           <goals>
452                             <goal>parse-version</goal>
453                           </goals>
454                         </execution>
455                       </executions>
456                     </plugin>
457                   </plugins>
458             </build>
459         </profile>
460     </profiles>
461
462     <build>
463         <finalName>${project.artifactId}</finalName>
464         <pluginManagement>
465           <plugins>
466             <plugin>
467               <groupId>org.codehaus.groovy.maven</groupId>
468               <artifactId>gmaven-plugin</artifactId>
469               <version>1.0</version>
470               <executions>
471                 <execution>
472                   <phase>validate</phase>
473                   <goals>
474                     <goal>execute</goal>
475                   </goals>
476                   <configuration>
477                     <source>
478                       def userAaiBaseImage = session.userProperties['aai.base.image']
479                       def userAaiCommonVersion = session.userProperties['aai.base.image.version']
480                       if (userAaiCommonVersion != null) {
481                           project.properties['aai.base.image.version'] = userAaiCommonVersion
482                       }
483                       if (userAaiBaseImage != null) {
484                           project.properties['aai.base.image'] = userAaiBaseImage
485                       }
486                       log.info 'Base image flavour: ' + project.properties['aai.base.image']
487                       log.info 'Base image version: ' + project.properties['aai.base.image.version']
488                     
489                       def versionArray;
490                       if (project.properties['aai.base.image.version'] != null) {
491                           versionArray = project.properties['aai.base.image.version'].split('\\.');
492                       }
493                     
494                       project.properties["project.major.version"] = versionArray[0];
495                       project.properties["project.minor.version"] = versionArray[1];
496                       project.properties['project.docker.latesttag.version'] = versionArray[0] + '.' + versionArray[1] + '-STAGING-latest';
497                       println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
498                   </source>
499                 </configuration>
500               </execution>
501             </executions>
502             </plugin>
503           </plugins>
504         </pluginManagement>
505         <!--
506             Using https://code.revelc.net/formatter-maven-plugin/ for Eclipse formatter
507             Using https://github.com/diffplug/spotless/tree/master/plugin-maven for import order
508             Use in combination to rewrite code and imports, then checkstyle
509
510             mvn formatter:format spotless:apply process-sources
511         -->
512         <plugins>
513           <plugin>
514                 <groupId>net.revelc.code.formatter</groupId>
515                 <artifactId>formatter-maven-plugin</artifactId>
516                 <version>2.8.1</version>
517                 <configuration>
518                     <configFile>${project.basedir}/onap-java-formatter.xml</configFile>
519                 </configuration>
520                 <!-- https://code.revelc.net/formatter-maven-plugin/
521                      use mvn formatter:format to rewrite source files
522                      use mvn formatter:validate to validate source files -->
523             </plugin>
524             <plugin>
525                 <groupId>com.diffplug.spotless</groupId>
526                 <artifactId>spotless-maven-plugin</artifactId>
527                 <version>1.18.0</version>
528                 <configuration>
529                     <java>
530                         <importOrder>
531                             <order>com,java,javax,org</order>
532                         </importOrder>
533                     </java>
534                 </configuration>
535                 <!-- https://github.com/diffplug/spotless/tree/master/plugin-maven
536                      use mvn spotless:apply to rewrite source files
537                      use mvn spotless:check to validate source files -->
538             </plugin>
539             <!-- license plugin -->
540             <!-- Uncomment this to add a license header to every source file -->
541             <plugin>
542                 <groupId>com.mycila</groupId>
543                 <artifactId>license-maven-plugin</artifactId>
544                 <version>3.0</version>
545                 <configuration>
546                     <header>License.txt</header>
547                     <includes>
548                         <include>src/main/java/**</include>
549                         <include>src/test/java/**</include>
550                         <include>pom.xml</include>
551                     </includes>
552                     <skipExistingHeaders>true</skipExistingHeaders>
553                 </configuration>
554                 <executions>
555                     <execution>
556                         <goals>
557                             <!-- Set goal from "check" to "format" to auto update license headers -->
558                             <goal>check</goal>
559                         </goals>
560                         <phase>process-sources</phase>
561                     </execution>
562                 </executions>
563             </plugin>
564
565             <plugin>
566                 <groupId>org.apache.maven.plugins</groupId>
567                 <artifactId>maven-site-plugin</artifactId>
568                 <version>3.3</version>
569                 <configuration>
570                     <reportPlugins>
571                         <plugin>
572                             <groupId>org.apache.maven.plugins</groupId>
573                             <artifactId>maven-checkstyle-plugin</artifactId>
574                             <version>2.17</version>
575                             <reportSets>
576                                 <reportSet>
577                                     <reports>
578                                         <report>checkstyle</report>
579                                     </reports>
580                                 </reportSet>
581                             </reportSets>
582                         </plugin>
583                     </reportPlugins>
584                 </configuration>
585             </plugin>
586             <plugin>
587                 <groupId>org.apache.maven.plugins</groupId>
588                 <artifactId>maven-deploy-plugin</artifactId>
589             </plugin>
590             <plugin>
591                 <groupId>org.springframework.boot</groupId>
592                 <artifactId>spring-boot-maven-plugin</artifactId>
593                 <version>2.0.1.RELEASE</version>
594                 <executions>
595                     <execution>
596                         <goals>
597                             <goal>repackage</goal>
598                         </goals>
599                     </execution>
600                 </executions>
601             </plugin>
602             <plugin>
603                 <artifactId>maven-assembly-plugin</artifactId>
604                 <configuration>
605                     <descriptors>
606                         <descriptor>src/main/assembly/descriptor.xml</descriptor>
607                     </descriptors>
608                 </configuration>
609                 <executions>
610                     <execution>
611                         <id>make-assembly</id>
612                         <phase>package</phase>
613                         <goals>
614                             <goal>single</goal>
615                         </goals>
616                     </execution>
617                 </executions>
618             </plugin>
619             <plugin>
620                 <groupId>org.apache.maven.plugins</groupId>
621                 <artifactId>maven-dependency-plugin</artifactId>
622                 <executions>
623                     <execution>
624                         <id>unpack</id>
625                         <phase>prepare-package</phase>
626                         <goals>
627                             <goal>unpack</goal>
628                         </goals>
629                         <configuration>
630                             <artifactItems>
631                                 <artifactItem>
632                                     <groupId>org.onap.aai.schema-service</groupId>
633                                     <artifactId>aai-schema</artifactId>
634                                     <version>${version.org.onap.aai.aai-schema}</version>
635                                     <type>jar</type>
636                                     <includes>onap/**/</includes>
637                                     <outputDirectory>${aai.build.directory}/bundleconfig/etc</outputDirectory>
638                                 </artifactItem>
639                             </artifactItems>
640                         </configuration>
641                     </execution>
642                 </executions>
643             </plugin>
644             <plugin>
645                 <groupId>org.jacoco</groupId>
646                 <artifactId>jacoco-maven-plugin</artifactId>
647                 <executions>
648                     <execution>
649                         <id>default-check</id>
650                         <goals>
651                             <goal>check</goal>
652                         </goals>
653                         <configuration>
654                             <dataFile>${jacoco.report.directory}/jacoco-ut.exec</dataFile>
655                             <rules>
656                                 <!--  implementation is needed only for Maven 2  -->
657                                 <rule implementation="org.jacoco.maven.RuleConfiguration">
658                                     <element>BUNDLE</element>
659                                     <limits>
660                                         <limit implementation="org.jacoco.report.check.Limit">
661                                             <counter>LINE</counter>
662                                             <value>COVEREDRATIO</value>
663                                             <minimum>${jacoco.line.coverage.limit}</minimum>
664                                         </limit>
665                                     </limits>
666                                 </rule>
667                             </rules>
668                         </configuration>
669                     </execution>
670                 </executions>
671             </plugin>
672
673         </plugins>
674     </build>
675
676     <distributionManagement>
677         <site>
678             <id>ecomp-javadoc</id>
679             <url>dav:https://ecomp-nexus:8443/repository/aai/gizmo-javadoc/${project.version}</url>
680         </site>
681     </distributionManagement>
682 </project>