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