1 <?xml version="1.0" encoding="UTF-8"?>
4 ============LICENSE_START=======================================================
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
14 http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
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>
29 <groupId>org.onap.aai.aai-common</groupId>
30 <artifactId>aai-parent</artifactId>
31 <version>1.13.3</version>
34 <groupId>org.onap.aai</groupId>
35 <artifactId>babel</artifactId>
36 <version>1.13.0-SNAPSHOT</version>
37 <packaging>jar</packaging>
39 <name>aai-babel</name>
40 <description>ONAP AAI Babel Microservice</description>
43 <!-- Spring boot version -->
45 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
46 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
48 <aai.schema.source.folder>onap/aai_schema</aai.schema.source.folder>
49 <aai.schema.target.folder>${project.build.directory}/aai-schema</aai.schema.target.folder>
51 <sonar.jacoco.reportPath />
52 <sonar.jacoco.itReportPath />
53 <sonar.jacoco.reportMissing.force.zero />
55 <jacoco.report.directory>${project.build.directory}/code-coverage</jacoco.report.directory>
56 <jacoco.line.coverage.limit>0.90</jacoco.line.coverage.limit>
57 <sonar.jacoco.reportPath />
58 <sonar.jacoco.itReportPath />
59 <sonar.jacoco.reportMissing.force.zero />
61 <jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>
63 <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
64 <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
65 <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
67 <sonar.scanner.version>3.7.0.1746</sonar.scanner.version>
69 <!-- java 11 related properties -->
70 <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
71 <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
72 <maven-compiler-plugin.source>11</maven-compiler-plugin.source>
73 <maven-compiler-plugin.target>11</maven-compiler-plugin.target>
74 <maven-compiler-plugin.test.source>11</maven-compiler-plugin.test.source>
75 <maven-compiler-plugin.test.target>11</maven-compiler-plugin.test.target>
76 <sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
78 <!-- docker related properties -->
79 <docker.fabric.version>0.28.0</docker.fabric.version>
80 <aai.docker.version>1.0.0</aai.docker.version>
81 <aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/
82 </aai.build.directory>
83 <aai.docker.namespace>onap</aai.docker.namespace>
84 <aai.base.image>alpine</aai.base.image>
85 <aai.base.image.version>1.9.0</aai.base.image.version>
87 <!-- Dependency Versions -->
88 <sdc.tosca.version>1.6.5</sdc.tosca.version>
90 <aai.common.version>1.9.4</aai.common.version>
91 <logback.core.version>1.2.11</logback.core.version>
92 <groovy.version>3.0.13</groovy.version>
93 <spring-cloud.version>2020.0.2</spring-cloud.version>
95 <commons.compress.version>1.22</commons.compress.version>
96 <commons.codec.version>1.15</commons.codec.version>
98 <javax.ws.rs.version>2.1.1</javax.ws.rs.version>
99 <mvn.jaxb2.version>0.15.1</mvn.jaxb2.version>
100 <aai-schema.group.id>org.onap.aai.schema-service</aai-schema.group.id>
102 <aai-schema.version>1.12.3</aai-schema.version>
103 <commons.lang3.version>3.12.0</commons.lang3.version>
104 <aai.rest.client.version>1.6.4</aai.rest.client.version>
106 <sdc.distribution.client.version>1.4.5</sdc.distribution.client.version>
107 <!-- TODO: use xml-legacy -->
108 <xmlunit.version>1.6</xmlunit.version>
110 <antrun.version>3.1.0</antrun.version>
111 <jakarta.activation.version>1.2.2</jakarta.activation.version>
112 <!-- This will be used for the docker images as the default format of maven build has issues -->
113 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
118 <!-- Docker profile to be used for building docker image and pushing to nexus -->
124 <groupId>org.codehaus.mojo</groupId>
125 <artifactId>build-helper-maven-plugin</artifactId>
126 <version>3.3.0</version>
129 <phase>pre-clean</phase>
130 <id>parse-version</id>
132 <goal>parse-version</goal>
138 <groupId>org.codehaus.gmavenplus</groupId>
139 <artifactId>gmavenplus-plugin</artifactId>
140 <version>1.13.1</version>
143 <phase>pre-clean</phase>
152 def userAaiBaseImage = session.userProperties['aai.base.image'];
153 def userAaiCommonVersion = session.userProperties['aai.base.image.version'];
154 if (userAaiCommonVersion != null) {
155 project.properties['aai.base.image.version'] = userAaiCommonVersion;
157 if (userAaiBaseImage != null) {
158 project.properties['aai.base.image'] = userAaiBaseImage;
160 log.info 'Base image flavour: ' + project.properties['aai.base.image'];
161 log.info 'Base image version: ' + project.properties['aai.base.image.version'];
167 <groupId>io.fabric8</groupId>
168 <artifactId>docker-maven-plugin</artifactId>
169 <version>${docker.fabric.version}</version>
171 <verbose>true</verbose>
172 <apiVersion>1.23</apiVersion>
175 <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l</name>
180 <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
181 <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
182 <tag>${image.tag}</tag>
184 <cleanup>try</cleanup>
185 <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
190 <directory>${aai.build.directory}</directory>
191 <outputDirectory>/${project.artifactId}</outputDirectory>
202 <id>clean-images</id>
203 <phase>pre-clean</phase>
208 <removeAll>true</removeAll>
212 <id>generate-images</id>
213 <phase>package</phase>
220 <phase>deploy</phase>
234 <groupId>org.springframework.boot</groupId>
235 <artifactId>spring-boot-starter-jetty</artifactId>
238 <groupId>org.springframework.boot</groupId>
239 <artifactId>spring-boot-starter-jersey</artifactId>
242 <groupId>org.springframework.boot</groupId>
243 <artifactId>spring-boot-starter-jetty</artifactId>
246 <groupId>org.springframework.boot</groupId>
247 <artifactId>spring-boot-starter-tomcat</artifactId>
252 <groupId>org.springframework.boot</groupId>
253 <artifactId>spring-boot-starter-web</artifactId>
256 <groupId>org.springframework.boot</groupId>
257 <artifactId>spring-boot-starter-jetty</artifactId>
260 <groupId>org.springframework.boot</groupId>
261 <artifactId>spring-boot-starter-tomcat</artifactId>
266 <groupId>org.springframework.boot</groupId>
267 <artifactId>spring-boot-starter-aop</artifactId>
270 <groupId>org.springframework.boot</groupId>
271 <artifactId>spring-boot-starter-tomcat</artifactId>
276 <groupId>org.onap.aai.logging-service</groupId>
277 <artifactId>common-logging</artifactId>
280 <groupId>ch.qos.logback</groupId>
281 <artifactId>logback-classic</artifactId>
284 <groupId>ch.qos.logback</groupId>
285 <artifactId>logback-core</artifactId>
286 <version>${logback.core.version}</version>
289 <groupId>commons-codec</groupId>
290 <artifactId>commons-codec</artifactId>
291 <version>${commons.codec.version}</version>
294 <groupId>org.apache.commons</groupId>
295 <artifactId>commons-compress</artifactId>
296 <version>${commons.compress.version}</version>
299 <groupId>org.apache.commons</groupId>
300 <artifactId>commons-lang3</artifactId>
301 <version>${commons.lang3.version}</version>
304 <groupId>javax.ws.rs</groupId>
305 <artifactId>javax.ws.rs-api</artifactId>
306 <version>${javax.ws.rs.version}</version>
309 <groupId>org.codehaus.groovy</groupId>
310 <artifactId>groovy</artifactId>
311 <version>${groovy.version}</version>
314 <groupId>org.onap.sdc.sdc-tosca</groupId>
315 <artifactId>sdc-tosca</artifactId>
316 <version>${sdc.tosca.version}</version>
319 <groupId>org.onap.aai</groupId>
320 <artifactId>rest-client</artifactId>
325 <groupId>org.springframework.boot</groupId>
326 <artifactId>spring-boot-starter-test</artifactId>
330 <groupId>org.onap.sdc.sdc-distribution-client</groupId>
331 <artifactId>sdc-distribution-client</artifactId>
332 <version>${sdc.distribution.client.version}</version>
336 <groupId>org.hamcrest</groupId>
337 <artifactId>hamcrest</artifactId>
338 <version>2.2</version>
342 <groupId>org.junit.jupiter</groupId>
343 <artifactId>junit-jupiter</artifactId>
344 <version>5.10.2</version>
348 <groupId>org.junit.jupiter</groupId>
349 <artifactId>junit-jupiter-api</artifactId>
354 <groupId>org.xmlunit</groupId>
355 <artifactId>xmlunit-legacy</artifactId>
359 <groupId>javax.xml.bind</groupId>
360 <artifactId>jaxb-api</artifactId>
363 <groupId>javax.xml.ws</groupId>
364 <artifactId>jaxws-api</artifactId>
367 <groupId>com.sun.xml.bind</groupId>
368 <artifactId>jaxb-core</artifactId>
371 <groupId>com.sun.xml.bind</groupId>
372 <artifactId>jaxb-impl</artifactId>
375 <groupId>jakarta.activation</groupId>
376 <artifactId>jakarta.activation-api</artifactId>
377 <version>${jakarta.activation.version}</version>
380 <groupId>org.springframework.cloud</groupId>
381 <artifactId>spring-cloud-starter-sleuth</artifactId>
384 <groupId>org.springframework.cloud</groupId>
385 <artifactId>spring-cloud-sleuth-zipkin</artifactId>
388 <groupId>org.projectlombok</groupId>
389 <artifactId>lombok</artifactId>
390 <version>1.18.32</version>
391 <scope>provided</scope>
394 <dependencyManagement>
397 <groupId>org.springframework.cloud</groupId>
398 <artifactId>spring-cloud-dependencies</artifactId>
399 <version>${spring-cloud.version}</version>
401 <scope>import</scope>
404 </dependencyManagement>
408 <groupId>org.springframework.boot</groupId>
409 <artifactId>spring-boot-maven-plugin</artifactId>
410 <version>${spring.boot.version}</version>
413 -DCONFIG_HOME=./appconfig-local
415 -Dtosca.mappings.config=./appconfig-local/tosca-mappings.json
416 -DKEY_STORE_PASSWORD=${KEY_STORE_PASSWORD}
422 <goal>repackage</goal>
428 <groupId>org.apache.maven.plugins</groupId>
429 <artifactId>maven-dependency-plugin</artifactId>
433 <phase>initialize</phase>
440 <groupId>${aai-schema.group.id}</groupId>
441 <artifactId>aai-schema</artifactId>
442 <version>${aai-schema.version}</version>
444 <includes>${aai.schema.source.folder}/aai_schema_v**.xsd</includes>
445 <outputDirectory>${project.build.directory}/tmp</outputDirectory>
453 <groupId>org.apache.maven.plugins</groupId>
454 <artifactId>maven-antrun-plugin</artifactId>
455 <version>${antrun.version}</version>
458 <id>Flatten XSDs</id>
459 <phase>initialize</phase>
465 <copy todir="${aai.schema.target.folder}" flatten="true">
466 <fileset dir="${project.build.directory}/tmp">
467 <include name="**/*.xsd" />
476 <groupId>org.jvnet.jaxb2.maven2</groupId>
477 <artifactId>maven-jaxb2-plugin</artifactId>
478 <version>${mvn.jaxb2.version}</version>
481 <phase>process-sources</phase>
483 <goal>generate</goal>
488 <schemaDirectory>${aai.schema.target.folder}</schemaDirectory>
489 <generatePackage>org.onap.aai.babel.xml.generator.xsd</generatePackage>
490 <generateDirectory>${project.build.directory}/generated-sources</generateDirectory>
492 <include>aai_schema_latest.xsd</include>
494 <extension>true</extension>
496 <arg>-Xannotate</arg>
500 <groupId>org.jvnet.jaxb2_commons</groupId>
501 <artifactId>jaxb2-basics-annotate</artifactId>
502 <version>0.6.4</version>
504 <!-- Add the dependencies with your annotations as 'plugins' below -->
506 <groupId>org.jvnet.jaxb2_commons</groupId>
507 <artifactId>jaxb2-annotate-plugin-test-annox-annotations</artifactId>
508 <version>1.0.0</version>
514 <artifactId>exec-maven-plugin</artifactId>
515 <groupId>org.codehaus.mojo</groupId>
516 <version>1.5.0</version>
519 <!-- Run our script to get latest xsd version -->
520 <id>Get latest xsd version</id>
521 <phase>generate-sources</phase>
526 <workingDirectory>${basedir}/scripts</workingDirectory>
527 <executable>bash</executable>
528 <commandlineArgs>get-latest-xsd-version.sh ${basedir}</commandlineArgs>
534 <artifactId>maven-assembly-plugin</artifactId>
537 <descriptor>src/main/assembly/descriptor.xml</descriptor>
542 <id>make-assembly</id>
543 <phase>package</phase>
551 <groupId>com.mycila</groupId>
552 <artifactId>license-maven-plugin</artifactId>
553 <version>3.0</version>
555 <header>License.txt</header>
557 <include>src/main/java/**</include>
558 <include>src/test/java/**</include>
559 <include>pom.xml</include>
561 <skipExistingHeaders>true</skipExistingHeaders>
566 <!-- Set goal from "check" to "format" to auto update license headers -->
569 <phase>validate</phase>
574 <groupId>org.apache.maven.plugins</groupId>
575 <artifactId>maven-compiler-plugin</artifactId>
576 <version>${maven-compiler-plugin.version}</version>
577 <inherited>true</inherited>
579 <source>${maven-compiler-plugin.source}</source>
580 <target>${maven-compiler-plugin.target}</target>
581 <testSource>${maven-compiler-plugin.test.source}</testSource>
582 <testTarget>${maven-compiler-plugin.test.target}</testTarget>
586 <groupId>org.apache.maven.plugins</groupId>
587 <artifactId>maven-jar-plugin</artifactId>
588 <version>3.0.2</version>
591 <phase>package</phase>
596 <classifier>client</classifier>
598 <include>**/babel/service/data/*</include>
605 <groupId>org.apache.maven.plugins</groupId>
606 <artifactId>maven-deploy-plugin</artifactId>
608 <classifier>client</classifier>
613 <!-- once we connect aai-parent or oparent 3.0+ we can take out this
617 <groupId>org.jacoco</groupId>
618 <artifactId>jacoco-maven-plugin</artifactId>
619 <version>${jacoco-maven-plugin.version}</version>
621 <!-- Note: This exclusion list should match <sonar.exclusions> property
624 <exclude>**/gen/**</exclude>
625 <exclude>**/generated-sources/**</exclude>
626 <exclude>**/yang-gen/**</exclude>
627 <exclude>**/pax/**</exclude>
628 <exclude>org/onap/aai/babel/xml/generator/xsd/*</exclude>
632 <!-- Prepares the property pointing to the JaCoCo runtime agent which
633 is passed as VM argument when Maven the Surefire plugin is executed. -->
635 <id>pre-unit-test</id>
637 <goal>prepare-agent</goal>
640 <!-- Sets the path to the file which contains the execution data
642 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
643 <!-- Sets the name of the property containing the settings for JaCoCo
645 <propertyName>surefireArgLine</propertyName>
648 <!-- Ensures that the code coverage report for unit tests is created
649 after unit tests have been run. -->
651 <id>post-unit-test</id>
657 <!-- Sets the path to the file which contains the execution data
659 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
660 <!-- Sets the output directory for the code coverage report. -->
661 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
665 <id>pre-integration-test</id>
666 <phase>pre-integration-test</phase>
668 <goal>prepare-agent</goal>
671 <!-- Sets the path to the file which contains the execution data
673 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
674 <!-- Sets the name of the property containing the settings for JaCoCo
676 <propertyName>failsafeArgLine</propertyName>
679 <!-- Ensures that the code coverage report for integration tests after
680 integration tests have been run. -->
682 <id>post-integration-test</id>
683 <phase>post-integration-test</phase>
688 <!-- Sets the path to the file which contains the execution data
690 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
691 <!-- Sets the output directory for the code coverage report. -->
692 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
696 <id>default-check</id>
701 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
703 <rule implementation="org.jacoco.maven.RuleConfiguration">
704 <element>BUNDLE</element>
706 <limit implementation="org.jacoco.report.check.Limit">
707 <counter>LINE</counter>
708 <value>COVEREDRATIO</value>
709 <minimum>${jacoco.line.coverage.limit}</minimum>
719 <groupId>org.apache.maven.plugins</groupId>
720 <artifactId>maven-surefire-plugin</artifactId>
721 <version>3.0.0-M4</version>
723 <!-- Sets the VM argument line used when unit tests are run. -->
724 <reuseForks>false</reuseForks>
725 <forkCount>1</forkCount>
726 <environmentVariables>
727 <APP_HOME>.</APP_HOME>
728 <CONFIG_HOME>src/test/resources</CONFIG_HOME>
729 </environmentVariables>
730 <argLine>${surefireArgLine}</argLine>
731 <!-- Excludes integration tests when unit tests are run. -->
733 <exclude>**/IT*.java</exclude>
738 <groupId>org.apache.maven.plugins</groupId>
739 <artifactId>maven-failsafe-plugin</artifactId>
740 <version>3.0.0-M5</version>
742 <!-- Ensures that both integration-test and verify goals of the Failsafe
743 Maven plugin are executed. -->
745 <id>integration-tests</id>
747 <goal>integration-test</goal>
751 <!-- Sets the VM argument line used when integration tests are run. -->
752 <argLine>${failsafeArgLine}</argLine>
758 <groupId>org.sonarsource.scanner.maven</groupId>
759 <artifactId>sonar-maven-plugin</artifactId>
760 <version>${sonar.scanner.version}</version>
762 <!-- end removable sonar config, note the additional exclusion for babel above -->