d318d996fc1e8b6b0b2450d61ad52e4acdca8866
[aai/babel.git] / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3
4     ============LICENSE_START=======================================================
5     org.onap.aai
6     ================================================================================
7     Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
8     Copyright (c) 2017-2019 European Software Marketing Ltd.
9     ================================================================================
10     Licensed under the Apache License, Version 2.0 (the "License");
11     you may not use this file except in compliance with the License.
12     You may obtain a copy of the License at
13
14           http://www.apache.org/licenses/LICENSE-2.0
15
16     Unless required by applicable law or agreed to in writing, software
17     distributed under the License is distributed on an "AS IS" BASIS,
18     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19     See the License for the specific language governing permissions and
20     limitations under the License.
21     ============LICENSE_END=========================================================
22
23 -->
24 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
25         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
26         <modelVersion>4.0.0</modelVersion>
27
28         <parent>
29                 <groupId>org.onap.oparent</groupId>
30                 <artifactId>oparent</artifactId>
31                 <version>2.0.0</version>
32                 <relativePath />
33         </parent>
34
35         <groupId>org.onap.aai</groupId>
36         <artifactId>babel</artifactId>
37         <version>1.6.1-SNAPSHOT</version>
38         <packaging>jar</packaging>
39
40         <name>aai-babel</name>
41         <description>ONAP AAI Babel Microservice</description>
42
43         <properties>
44                 <!-- Spring boot version -->
45                 <spring.boot.version>2.1.6.RELEASE</spring.boot.version>
46
47                 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
48                 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
49                 <java.version>1.8</java.version>
50                 <aai.schema.source.folder>onap/aai_schema</aai.schema.source.folder>
51                 <aai.schema.target.folder>${project.build.directory}/aai-schema</aai.schema.target.folder>
52                 <jacoco.report.directory>${project.build.directory}/code-coverage</jacoco.report.directory>
53                 <jacoco.line.coverage.limit>0.90</jacoco.line.coverage.limit>
54
55         <!-- docker related properties -->
56                 <docker.fabric.version>0.28.0</docker.fabric.version>
57                 <aai.docker.version>1.0.0</aai.docker.version>
58                 <aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/
59                 </aai.build.directory>
60                 <aai.docker.namespace>onap</aai.docker.namespace>
61                 <aai.base.image>alpine</aai.base.image>
62                 <aai.base.image.version>1.6.0</aai.base.image.version>
63
64                 <!-- Dependency Versions -->
65                 <common.logging.version>1.2.2</common.logging.version>
66                 <sdc.tosca.version>1.5.1</sdc.tosca.version>
67                 <commons.compress.version>1.18</commons.compress.version>
68                 <javax.ws.rs.version>2.1</javax.ws.rs.version>
69                 <mvn.jaxb2.version>0.13.2</mvn.jaxb2.version>
70                 <aai-schema.group.id>org.onap.aai.schema-service</aai-schema.group.id>
71                 <aai-schema.version>1.6.0</aai-schema.version>
72                 <aai.rest.client.version>1.2.1</aai.rest.client.version>
73                 <sdc.distribution.client.version>1.3.0</sdc.distribution.client.version>
74                 <xmlunit.version>1.6</xmlunit.version>
75                 <logback.version>1.2.3</logback.version>
76                 <antrun.version>1.8</antrun.version>
77         <!-- This will be used for the docker images as the default format of maven build has issues -->
78                 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
79         </properties>
80
81         <dependencyManagement>
82                 <dependencies>
83                         <dependency>
84                                 <!-- Import dependency management from Spring Boot -->
85                                 <groupId>org.springframework.boot</groupId>
86                                 <artifactId>spring-boot-dependencies</artifactId>
87                                 <version>${spring.boot.version}</version>
88                                 <type>pom</type>
89                                 <scope>import</scope>
90                         </dependency>
91                 </dependencies>
92         </dependencyManagement>
93
94         <profiles>
95         <!-- Docker profile to be used for building docker image and pushing to nexus -->
96                 <profile>
97                         <id>docker</id>
98                         <build>
99                                 <plugins>
100                                         <plugin>
101                                                 <groupId>org.codehaus.mojo</groupId>
102                                                 <artifactId>build-helper-maven-plugin</artifactId>
103                                                 <version>3.0.0</version>
104                                                 <executions>
105                                                         <execution>
106                                                                 <phase>pre-clean</phase>
107                                                                 <id>parse-version</id>
108                                                                 <goals>
109                                                                         <goal>parse-version</goal>
110                                                                 </goals>
111                                                         </execution>
112                                                 </executions>
113                                         </plugin>
114                                         <plugin>
115                                                 <groupId>org.codehaus.groovy.maven</groupId>
116                                                 <artifactId>gmaven-plugin</artifactId>
117                                                 <version>1.0</version>
118                                                 <executions>
119                                                         <execution>
120                                                                 <phase>pre-clean</phase>
121                                                                 <goals>
122                                                                         <goal>execute</goal>
123                                                                 </goals>
124                                                                 <configuration>
125                                                                         <source>
126                                                                                 def userAaiBaseImage = session.userProperties['aai.base.image'];
127                                                                                 def userAaiCommonVersion = session.userProperties['aai.base.image.version'];
128                                                                                 if (userAaiCommonVersion != null) {
129                                                                                 project.properties['aai.base.image.version'] = userAaiCommonVersion;
130                                                                                 }
131                                                                                 if (userAaiBaseImage != null) {
132                                                                                 project.properties['aai.base.image'] = userAaiBaseImage;
133                                                                                 }
134                                                                                 log.info 'Base image flavour: ' + project.properties['aai.base.image'];
135                                                                                 log.info 'Base image version: ' + project.properties['aai.base.image.version'];
136                                                                         </source>
137                                                                 </configuration>
138                                                         </execution>
139                                                 </executions>
140                                         </plugin>
141                                         <plugin>
142                                                 <groupId>io.fabric8</groupId>
143                                                 <artifactId>docker-maven-plugin</artifactId>
144                                                 <version>${docker.fabric.version}</version>
145                                                 <configuration>
146                                                         <verbose>true</verbose>
147                                                         <apiVersion>1.23</apiVersion>
148                                                         <images>
149                                                                 <image>
150                                                                         <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l
151                                                                         </name>
152                                                                         <build>
153                                                                                 <filter>@</filter>
154                                                                                 <tags>
155                                                                                         <tag>latest</tag>
156                                                                                         <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
157                                                                                         <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
158                                                                                 </tags>
159                                                                                 <cleanup>try</cleanup>
160                                                                                 <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
161                                                                                 <assembly>
162                                                                                         <inline>
163                                                                                                 <fileSets>
164                                                                                                         <fileSet>
165                                                                                                                 <directory>${aai.build.directory}</directory>
166                                                                                                                 <outputDirectory>/${project.artifactId}</outputDirectory>
167                                                                                                         </fileSet>
168                                                                                                 </fileSets>
169                                                                                         </inline>
170                                                                                 </assembly>
171                                                                         </build>
172                                                                 </image>
173                                                         </images>
174                                                 </configuration>
175                                                 <executions>
176                                                         <execution>
177                                                                 <id>clean-images</id>
178                                                                 <phase>pre-clean</phase>
179                                                                 <goals>
180                                                                         <goal>remove</goal>
181                                                                 </goals>
182                                                                 <configuration>
183                                                                         <removeAll>true</removeAll>
184                                                                 </configuration>
185                                                         </execution>
186                                                         <execution>
187                                                                 <id>generate-images</id>
188                                                                 <phase>package</phase>
189                                                                 <goals>
190                                                                         <goal>build</goal>
191                                                                 </goals>
192                                                         </execution>
193                                                         <execution>
194                                                                 <id>push-images</id>
195                                                                 <phase>deploy</phase>
196                                                                 <goals>
197                                                                         <goal>push</goal>
198                                                                 </goals>
199                                                         </execution>
200                                                 </executions>
201                                         </plugin>
202                                 </plugins>
203                         </build>
204                 </profile>
205         </profiles>
206         <dependencies>
207                 <dependency>
208                         <groupId>org.springframework.boot</groupId>
209                         <artifactId>spring-boot-starter-jetty</artifactId>
210                 </dependency>
211                 <dependency>
212                         <groupId>org.springframework.boot</groupId>
213                         <artifactId>spring-boot-starter-jersey</artifactId>
214                         <exclusions>
215                                 <exclusion>
216                                         <groupId>org.springframework.boot</groupId>
217                                         <artifactId>spring-boot-starter-tomcat</artifactId>
218                                 </exclusion>
219                         </exclusions>
220                 </dependency>
221                 <dependency>
222                         <groupId>org.onap.aai.logging-service</groupId>
223                         <artifactId>common-logging</artifactId>
224                         <version>${common.logging.version}</version>
225                 </dependency>
226                 <dependency>
227                         <groupId>ch.qos.logback</groupId>
228                         <artifactId>logback-classic</artifactId>
229                         <version>${logback.version}</version><!--$NO-MVN-MAN-VER$-->
230                 </dependency>
231                 <dependency>
232                         <groupId>ch.qos.logback</groupId>
233                         <artifactId>logback-core</artifactId>
234                         <version>${logback.version}</version><!--$NO-MVN-MAN-VER$-->
235                 </dependency>
236                 <dependency>
237                         <groupId>commons-codec</groupId>
238                         <artifactId>commons-codec</artifactId>
239                 </dependency>
240                 <dependency>
241                         <groupId>org.apache.commons</groupId>
242                         <artifactId>commons-compress</artifactId>
243                         <version>${commons.compress.version}</version>
244                 </dependency>
245                 <dependency>
246                         <groupId>org.apache.commons</groupId>
247                         <artifactId>commons-lang3</artifactId>
248                 </dependency>
249                 <dependency>
250                         <groupId>javax.ws.rs</groupId>
251                         <artifactId>javax.ws.rs-api</artifactId>
252                         <version>${javax.ws.rs.version}</version>
253                 </dependency>
254                 <dependency>
255                         <groupId>org.codehaus.groovy</groupId>
256                         <artifactId>groovy</artifactId>
257                 </dependency>
258                 <dependency>
259                         <groupId>org.onap.sdc.sdc-tosca</groupId>
260                         <artifactId>sdc-tosca</artifactId>
261                         <version>${sdc.tosca.version}</version>
262                 </dependency>
263                 <dependency>
264                         <groupId>org.onap.aai</groupId>
265                         <artifactId>rest-client</artifactId>
266                         <version>${aai.rest.client.version}</version>
267                 </dependency>
268                 
269                 <!-- Testing -->
270                 <dependency>
271                         <groupId>org.springframework.boot</groupId>
272                         <artifactId>spring-boot-starter-test</artifactId>
273                         <scope>test</scope>
274                 </dependency>
275                 <dependency>
276                         <groupId>org.onap.sdc.sdc-distribution-client</groupId>
277                         <artifactId>sdc-distribution-client</artifactId>
278                         <version>${sdc.distribution.client.version}</version>
279                         <scope>test</scope>
280                 </dependency>
281                 <dependency>
282                         <groupId>xmlunit</groupId>
283                         <artifactId>xmlunit</artifactId>
284                         <version>${xmlunit.version}</version>
285                         <scope>test</scope>
286                 </dependency>
287         </dependencies>
288
289         <build>
290                 <plugins>
291                         <plugin>
292                                 <groupId>org.springframework.boot</groupId>
293                                 <artifactId>spring-boot-maven-plugin</artifactId>
294                                 <version>${spring.boot.version}</version>
295                                 <configuration>
296                                         <jvmArguments>
297                                                 -DCONFIG_HOME=./appconfig-local
298                                                 -DAPP_HOME=.
299                                                 -Dtosca.mappings.config=./appconfig-local/tosca-mappings.json
300                                                 -DKEY_STORE_PASSWORD=${KEY_STORE_PASSWORD}
301                                         </jvmArguments>
302                                 </configuration>
303                                 <executions>
304                                         <execution>
305                                                 <goals>
306                                                         <goal>repackage</goal>
307                                                 </goals>
308                                         </execution>
309                                 </executions>
310                         </plugin>
311                         <plugin>
312                                 <groupId>org.apache.maven.plugins</groupId>
313                                 <artifactId>maven-dependency-plugin</artifactId>
314                                 <executions>
315                                         <execution>
316                                                 <id>unpack</id>
317                                                 <phase>initialize</phase>
318                                                 <goals>
319                                                         <goal>unpack</goal>
320                                                 </goals>
321                                                 <configuration>
322                                                         <artifactItems>
323                                                                 <artifactItem>
324                                                                         <groupId>${aai-schema.group.id}</groupId>
325                                                                         <artifactId>aai-schema</artifactId>
326                                                                         <version>${aai-schema.version}</version>
327                                                                         <type>jar</type>
328                                                                         <includes>${aai.schema.source.folder}/aai_schema_v**.xsd</includes>
329                                                                         <outputDirectory>${project.build.directory}/tmp</outputDirectory>
330                                                                 </artifactItem>
331                                                         </artifactItems>
332                                                 </configuration>
333                                         </execution>
334                                 </executions>
335                         </plugin>
336                         <plugin>
337                                 <groupId>org.apache.maven.plugins</groupId>
338                                 <artifactId>maven-antrun-plugin</artifactId>
339                                 <version>${antrun.version}</version>
340                                 <executions>
341                                         <execution>
342                                                 <id>Flatten XSDs</id>
343                                                 <phase>initialize</phase>
344                                                 <goals>
345                                                         <goal>run</goal>
346                                                 </goals>
347                                                 <configuration>
348                                                         <target>
349                                                                 <copy todir="${aai.schema.target.folder}" flatten="true">
350                                                                         <fileset dir="${project.build.directory}/tmp">
351                                                                                 <include name="**/*.xsd" />
352                                                                         </fileset>
353                                                                 </copy>
354                                                         </target>
355                                                 </configuration>
356                                         </execution>
357                                 </executions>
358                         </plugin>
359                         <plugin>
360                                 <groupId>org.jvnet.jaxb2.maven2</groupId>
361                                 <artifactId>maven-jaxb2-plugin</artifactId>
362                                 <version>${mvn.jaxb2.version}</version>
363                                 <executions>
364                                         <execution>
365                                                 <phase>process-sources</phase>
366                                                 <goals>
367                                                         <goal>generate</goal>
368                                                 </goals>
369                                         </execution>
370                                 </executions>
371                                 <configuration>
372                                         <schemaDirectory>${aai.schema.target.folder}</schemaDirectory>
373                                         <generatePackage>org.onap.aai.babel.xml.generator.xsd</generatePackage>
374                                         <generateDirectory>${project.build.directory}/generated-sources</generateDirectory>
375                                         <schemaIncludes>
376                                                 <include>aai_schema_latest.xsd</include>
377                                         </schemaIncludes>
378                                         <extension>true</extension>
379                                         <args>
380                                                 <arg>-Xannotate</arg>
381                                         </args>
382                                         <plugins>
383                                                 <plugin>
384                                                         <groupId>org.jvnet.jaxb2_commons</groupId>
385                                                         <artifactId>jaxb2-basics-annotate</artifactId>
386                                                         <version>0.6.4</version>
387                                                 </plugin>
388                                                 <!-- Add the dependencies with your annotations as 'plugins' below -->
389                                                 <plugin>
390                                                         <groupId>org.jvnet.jaxb2_commons</groupId>
391                                                         <artifactId>jaxb2-annotate-plugin-test-annox-annotations</artifactId>
392                                                         <version>1.0.0</version>
393                                                 </plugin>
394                                         </plugins>
395                                 </configuration>
396                         </plugin>
397                         <plugin>
398                                 <artifactId>exec-maven-plugin</artifactId>
399                                 <groupId>org.codehaus.mojo</groupId>
400                                 <version>1.5.0</version>
401                                 <executions>
402                                         <execution><!-- Run our script to get latest xsd version -->
403                                                 <id>Get latest xsd version</id>
404                                                 <phase>generate-sources</phase>
405                                                 <goals>
406                                                         <goal>exec</goal>
407                                                 </goals>
408                                                 <configuration>
409                                                         <workingDirectory>${basedir}/scripts</workingDirectory>
410                                                         <executable>bash</executable>
411                                                         <commandlineArgs>get-latest-xsd-version.sh ${basedir}</commandlineArgs>
412                                                 </configuration>
413                                         </execution>
414                                 </executions>
415                         </plugin>
416                         <plugin>
417                                 <artifactId>maven-assembly-plugin</artifactId>
418                                 <configuration>
419                                         <descriptors>
420                                                 <descriptor>src/main/assembly/descriptor.xml</descriptor>
421                                         </descriptors>
422                                 </configuration>
423                                 <executions>
424                                         <execution>
425                                                 <id>make-assembly</id>
426                                                 <phase>package</phase>
427                                                 <goals>
428                                                         <goal>single</goal>
429                                                 </goals>
430                                         </execution>
431                                 </executions>
432                         </plugin>
433                         <plugin>
434                                 <groupId>com.mycila</groupId>
435                                 <artifactId>license-maven-plugin</artifactId>
436                                 <version>3.0</version>
437                                 <configuration>
438                                         <header>License.txt</header>
439                                         <includes>
440                                                 <include>src/main/java/**</include>
441                                                 <include>src/test/java/**</include>
442                                                 <include>pom.xml</include>
443                                         </includes>
444                                         <skipExistingHeaders>true</skipExistingHeaders>
445                                 </configuration>
446                                 <executions>
447                                         <execution>
448                                                 <goals>
449                                                         <!-- Set goal from "check" to "format" to auto update license headers -->
450                                                         <goal>check</goal>
451                                                 </goals>
452                                                 <phase>validate</phase>
453                                         </execution>
454                                 </executions>
455                         </plugin>
456                         <plugin>
457                                 <groupId>org.apache.maven.plugins</groupId>
458                                 <artifactId>maven-surefire-plugin</artifactId>
459                                 <configuration>
460                                         <reuseForks>false</reuseForks>
461                                         <forkCount>1</forkCount>
462                                         <environmentVariables>
463                                                 <APP_HOME>.</APP_HOME>
464                                                 <CONFIG_HOME>src/test/resources</CONFIG_HOME>
465                                         </environmentVariables>
466                                 </configuration>
467                         </plugin>
468                         <plugin>
469                                 <groupId>org.apache.maven.plugins</groupId>
470                                 <artifactId>maven-jar-plugin</artifactId>
471                                 <version>3.0.2</version>
472                                 <executions>
473                                         <execution>
474                                                 <phase>package</phase>
475                                                 <goals>
476                                                         <goal>jar</goal>
477                                                 </goals>
478                                                 <configuration>
479                                                         <classifier>client</classifier>
480                                                         <includes>
481                                                                 <include>**/babel/service/data/*</include>
482                                                         </includes>
483                                                 </configuration>
484                                         </execution>
485                                 </executions>
486                         </plugin>
487                         <plugin>
488                                 <groupId>org.apache.maven.plugins</groupId>
489                                 <artifactId>maven-deploy-plugin</artifactId>
490                                 <configuration>
491                                         <classifier>client</classifier>
492                                 </configuration>
493                         </plugin>
494                         <plugin>
495                                 <groupId>org.jacoco</groupId>
496                                 <artifactId>jacoco-maven-plugin</artifactId>
497                                 <configuration>
498                                         <excludes>
499                                                 <exclude>org/onap/aai/babel/xml/generator/xsd/*</exclude>
500                                         </excludes>
501                                 </configuration>
502                                 <executions>
503                                         <execution>
504                                                 <id>default-check</id>
505                                                 <goals>
506                                                         <goal>check</goal>
507                                                 </goals>
508                                                 <configuration>
509                                                         <dataFile>${jacoco.report.directory}/jacoco-ut.exec</dataFile>
510                                                         <rules>
511                                 <!--  implementation is needed only for Maven 2  -->
512                                                                 <rule implementation="org.jacoco.maven.RuleConfiguration">
513                                                                         <element>BUNDLE</element>
514                                                                         <limits>
515                                                                                 <limit implementation="org.jacoco.report.check.Limit">
516                                                                                         <counter>LINE</counter>
517                                                                                         <value>COVEREDRATIO</value>
518                                                                                         <minimum>${jacoco.line.coverage.limit}</minimum>
519                                                                                 </limit>
520                                                                         </limits>
521                                                                 </rule>
522                                                         </rules>
523                                                 </configuration>
524                                         </execution>
525                                 </executions>
526                         </plugin>
527                 </plugins>
528         </build>
529
530 </project>