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.8.1</version>
34 <groupId>org.onap.aai</groupId>
35 <artifactId>babel</artifactId>
36 <version>1.8.1-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.8.1</aai.base.image.version>
87 <!-- Dependency Versions -->
88 <sdc.tosca.version>1.5.1</sdc.tosca.version>
90 <aai.common.version>1.8.1</aai.common.version>
91 <aaf.version>2.1.21</aaf.version>
92 <common.logging.version>1.2.2</common.logging.version>
94 <commons.compress.version>1.19</commons.compress.version>
96 <javax.ws.rs.version>2.1</javax.ws.rs.version>
97 <mvn.jaxb2.version>0.13.3</mvn.jaxb2.version>
98 <aai-schema.group.id>org.onap.aai.schema-service</aai-schema.group.id>
100 <aai-schema.version>1.8.3</aai-schema.version>
101 <apache.lang3.version>3.7</apache.lang3.version>
102 <aai.rest.client.version>1.2.1</aai.rest.client.version>
104 <sdc.distribution.client.version>1.4.1</sdc.distribution.client.version>
105 <xmlunit.version>1.6</xmlunit.version>
107 <antrun.version>1.8</antrun.version>
109 <javax.activation.version>1.1.1</javax.activation.version>
110 <!-- This will be used for the docker images as the default format of maven build has issues -->
111 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
116 <!-- Docker profile to be used for building docker image and pushing to nexus -->
123 <groupId>org.codehaus.mojo</groupId>
124 <artifactId>build-helper-maven-plugin</artifactId>
125 <version>3.0.0</version>
128 <phase>pre-clean</phase>
129 <id>parse-version</id>
131 <goal>parse-version</goal>
137 <groupId>org.codehaus.groovy.maven</groupId>
138 <artifactId>gmaven-plugin</artifactId>
139 <version>1.0</version>
142 <phase>pre-clean</phase>
148 def userAaiBaseImage = session.userProperties['aai.base.image'];
149 def userAaiCommonVersion = session.userProperties['aai.base.image.version'];
150 if (userAaiCommonVersion != null) {
151 project.properties['aai.base.image.version'] = userAaiCommonVersion;
153 if (userAaiBaseImage != null) {
154 project.properties['aai.base.image'] = userAaiBaseImage;
156 log.info 'Base image flavour: ' + project.properties['aai.base.image'];
157 log.info 'Base image version: ' + project.properties['aai.base.image.version'];
164 <groupId>io.fabric8</groupId>
165 <artifactId>docker-maven-plugin</artifactId>
166 <version>${docker.fabric.version}</version>
168 <verbose>true</verbose>
169 <apiVersion>1.23</apiVersion>
172 <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l
178 <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
179 <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
180 <tag>${image.tag}</tag>
182 <cleanup>try</cleanup>
183 <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
188 <directory>${aai.build.directory}</directory>
189 <outputDirectory>/${project.artifactId}</outputDirectory>
200 <id>clean-images</id>
201 <phase>pre-clean</phase>
206 <removeAll>true</removeAll>
210 <id>generate-images</id>
211 <phase>package</phase>
218 <phase>deploy</phase>
232 <groupId>org.springframework.boot</groupId>
233 <artifactId>spring-boot-starter-jetty</artifactId>
236 <groupId>org.springframework.boot</groupId>
237 <artifactId>spring-boot-starter-jersey</artifactId>
240 <groupId>org.springframework.boot</groupId>
241 <artifactId>spring-boot-starter-jetty</artifactId>
244 <groupId>org.springframework.boot</groupId>
245 <artifactId>spring-boot-starter-tomcat</artifactId>
250 <groupId>org.springframework.boot</groupId>
251 <artifactId>spring-boot-starter-web</artifactId>
254 <groupId>org.springframework.boot</groupId>
255 <artifactId>spring-boot-starter-jetty</artifactId>
258 <groupId>org.springframework.boot</groupId>
259 <artifactId>spring-boot-starter-tomcat</artifactId>
264 <groupId>org.springframework.boot</groupId>
265 <artifactId>spring-boot-starter-aop</artifactId>
268 <groupId>org.springframework.boot</groupId>
269 <artifactId>spring-boot-starter-tomcat</artifactId>
274 <groupId>org.onap.aai.logging-service</groupId>
275 <artifactId>common-logging</artifactId>
278 <groupId>ch.qos.logback</groupId>
279 <artifactId>logback-classic</artifactId>
282 <groupId>ch.qos.logback</groupId>
283 <artifactId>logback-core</artifactId>
286 <groupId>commons-codec</groupId>
287 <artifactId>commons-codec</artifactId>
290 <groupId>org.apache.commons</groupId>
291 <artifactId>commons-compress</artifactId>
294 <groupId>org.apache.commons</groupId>
295 <artifactId>commons-lang3</artifactId>
298 <groupId>javax.ws.rs</groupId>
299 <artifactId>javax.ws.rs-api</artifactId>
300 <version>2.1</version>
303 <groupId>org.codehaus.groovy</groupId>
304 <artifactId>groovy</artifactId>
307 <groupId>org.onap.sdc.sdc-tosca</groupId>
308 <artifactId>sdc-tosca</artifactId>
309 <version>${sdc.tosca.version}</version>
312 <groupId>org.onap.aai</groupId>
313 <artifactId>rest-client</artifactId>
316 <groupId>org.onap.aai.aai-common</groupId>
317 <artifactId>aai-aaf-auth</artifactId>
318 <version>${aai.common.version}</version>
321 <groupId>org.springframework.boot</groupId>
322 <artifactId>spring-boot-starter-web</artifactId>
327 <groupId>org.onap.aaf.authz</groupId>
328 <artifactId>aaf-cadi-core</artifactId>
329 <version>${aaf.version}</version>
330 <scope>compile</scope>
333 <groupId>org.onap.aaf.authz</groupId>
334 <artifactId>aaf-cadi-aaf</artifactId>
335 <version>${aaf.version}</version>
336 <scope>compile</scope>
339 <groupId>org.onap.aaf.authz</groupId>
340 <artifactId>aaf-auth-client</artifactId>
341 <version>${aaf.version}</version>
344 <groupId>org.onap.aaf.authz</groupId>
345 <artifactId>aaf-cadi-client</artifactId>
346 <version>${aaf.version}</version>
349 <groupId>org.onap.aaf.authz</groupId>
350 <artifactId>aaf-misc-env</artifactId>
351 <version>${aaf.version}</version>
354 <groupId>org.onap.aaf.authz</groupId>
355 <artifactId>aaf-misc-rosetta</artifactId>
356 <version>${aaf.version}</version>
361 <groupId>org.springframework.boot</groupId>
362 <artifactId>spring-boot-starter-test</artifactId>
366 <groupId>org.onap.sdc.sdc-distribution-client</groupId>
367 <artifactId>sdc-distribution-client</artifactId>
368 <version>${sdc.distribution.client.version}</version>
372 <groupId>junit</groupId>
373 <artifactId>junit</artifactId>
374 <version>4.12</version>
379 <groupId>xmlunit</groupId>
380 <artifactId>xmlunit</artifactId>
381 <version>${xmlunit.version}</version>
385 <groupId>javax.xml.bind</groupId>
386 <artifactId>jaxb-api</artifactId>
389 <groupId>javax.xml.ws</groupId>
390 <artifactId>jaxws-api</artifactId>
393 <groupId>com.sun.xml.bind</groupId>
394 <artifactId>jaxb-core</artifactId>
397 <groupId>com.sun.xml.bind</groupId>
398 <artifactId>jaxb-impl</artifactId>
401 <groupId>javax.activation</groupId>
402 <artifactId>activation</artifactId>
403 <version>${javax.activation.version}</version>
410 <groupId>org.springframework.boot</groupId>
411 <artifactId>spring-boot-maven-plugin</artifactId>
412 <version>${spring.boot.version}</version>
415 -DCONFIG_HOME=./appconfig-local
417 -Dtosca.mappings.config=./appconfig-local/tosca-mappings.json
418 -DKEY_STORE_PASSWORD=${KEY_STORE_PASSWORD}
424 <goal>repackage</goal>
430 <groupId>org.apache.maven.plugins</groupId>
431 <artifactId>maven-dependency-plugin</artifactId>
435 <phase>initialize</phase>
442 <groupId>${aai-schema.group.id}</groupId>
443 <artifactId>aai-schema</artifactId>
444 <version>${aai-schema.version}</version>
446 <includes>${aai.schema.source.folder}/aai_schema_v**.xsd</includes>
447 <outputDirectory>${project.build.directory}/tmp</outputDirectory>
455 <groupId>org.apache.maven.plugins</groupId>
456 <artifactId>maven-antrun-plugin</artifactId>
457 <version>${antrun.version}</version>
460 <id>Flatten XSDs</id>
461 <phase>initialize</phase>
467 <copy todir="${aai.schema.target.folder}" flatten="true">
468 <fileset dir="${project.build.directory}/tmp">
469 <include name="**/*.xsd" />
478 <groupId>org.jvnet.jaxb2.maven2</groupId>
479 <artifactId>maven-jaxb2-plugin</artifactId>
480 <version>${mvn.jaxb2.version}</version>
483 <phase>process-sources</phase>
485 <goal>generate</goal>
490 <schemaDirectory>${aai.schema.target.folder}</schemaDirectory>
491 <generatePackage>org.onap.aai.babel.xml.generator.xsd</generatePackage>
492 <generateDirectory>${project.build.directory}/generated-sources</generateDirectory>
494 <include>aai_schema_latest.xsd</include>
496 <extension>true</extension>
498 <arg>-Xannotate</arg>
502 <groupId>org.jvnet.jaxb2_commons</groupId>
503 <artifactId>jaxb2-basics-annotate</artifactId>
504 <version>0.6.4</version>
506 <!-- Add the dependencies with your annotations as 'plugins' below -->
508 <groupId>org.jvnet.jaxb2_commons</groupId>
509 <artifactId>jaxb2-annotate-plugin-test-annox-annotations</artifactId>
510 <version>1.0.0</version>
516 <artifactId>exec-maven-plugin</artifactId>
517 <groupId>org.codehaus.mojo</groupId>
518 <version>1.5.0</version>
520 <execution><!-- Run our script to get latest xsd version -->
521 <id>Get latest xsd version</id>
522 <phase>generate-sources</phase>
527 <workingDirectory>${basedir}/scripts</workingDirectory>
528 <executable>bash</executable>
529 <commandlineArgs>get-latest-xsd-version.sh ${basedir}</commandlineArgs>
535 <artifactId>maven-assembly-plugin</artifactId>
538 <descriptor>src/main/assembly/descriptor.xml</descriptor>
543 <id>make-assembly</id>
544 <phase>package</phase>
552 <groupId>com.mycila</groupId>
553 <artifactId>license-maven-plugin</artifactId>
554 <version>3.0</version>
556 <header>License.txt</header>
558 <include>src/main/java/**</include>
559 <include>src/test/java/**</include>
560 <include>pom.xml</include>
562 <skipExistingHeaders>true</skipExistingHeaders>
567 <!-- Set goal from "check" to "format" to auto update license headers -->
570 <phase>validate</phase>
575 <groupId>org.apache.maven.plugins</groupId>
576 <artifactId>maven-compiler-plugin</artifactId>
577 <version>${maven-compiler-plugin.version}</version>
578 <inherited>true</inherited>
580 <source>${maven-compiler-plugin.source}</source>
581 <target>${maven-compiler-plugin.target}</target>
582 <testSource>${maven-compiler-plugin.test.source}</testSource>
583 <testTarget>${maven-compiler-plugin.test.target}</testTarget>
587 <groupId>org.apache.maven.plugins</groupId>
588 <artifactId>maven-jar-plugin</artifactId>
589 <version>3.0.2</version>
592 <phase>package</phase>
597 <classifier>client</classifier>
599 <include>**/babel/service/data/*</include>
606 <groupId>org.apache.maven.plugins</groupId>
607 <artifactId>maven-deploy-plugin</artifactId>
609 <classifier>client</classifier>
614 <!-- once we connect aai-parent or oparent 3.0+ we can take out this
618 <groupId>org.jacoco</groupId>
619 <artifactId>jacoco-maven-plugin</artifactId>
620 <version>${jacoco-maven-plugin.version}</version>
622 <!-- Note: This exclusion list should match <sonar.exclusions> property
625 <exclude>**/gen/**</exclude>
626 <exclude>**/generated-sources/**</exclude>
627 <exclude>**/yang-gen/**</exclude>
628 <exclude>**/pax/**</exclude>
629 <exclude>org/onap/aai/babel/xml/generator/xsd/*</exclude>
633 <!-- Prepares the property pointing to the JaCoCo runtime agent which
634 is passed as VM argument when Maven the Surefire plugin is executed. -->
636 <id>pre-unit-test</id>
638 <goal>prepare-agent</goal>
641 <!-- Sets the path to the file which contains the execution data
643 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
644 <!-- Sets the name of the property containing the settings for JaCoCo
646 <propertyName>surefireArgLine</propertyName>
649 <!-- Ensures that the code coverage report for unit tests is created
650 after unit tests have been run. -->
652 <id>post-unit-test</id>
658 <!-- Sets the path to the file which contains the execution data
660 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
661 <!-- Sets the output directory for the code coverage report. -->
662 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
666 <id>pre-integration-test</id>
667 <phase>pre-integration-test</phase>
669 <goal>prepare-agent</goal>
672 <!-- Sets the path to the file which contains the execution data
674 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
675 <!-- Sets the name of the property containing the settings for JaCoCo
677 <propertyName>failsafeArgLine</propertyName>
680 <!-- Ensures that the code coverage report for integration tests after
681 integration tests have been run. -->
683 <id>post-integration-test</id>
684 <phase>post-integration-test</phase>
689 <!-- Sets the path to the file which contains the execution data
691 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
692 <!-- Sets the output directory for the code coverage report. -->
693 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
697 <id>default-check</id>
702 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
704 <rule implementation="org.jacoco.maven.RuleConfiguration">
705 <element>BUNDLE</element>
707 <limit implementation="org.jacoco.report.check.Limit">
708 <counter>LINE</counter>
709 <value>COVEREDRATIO</value>
710 <minimum>${jacoco.line.coverage.limit}</minimum>
720 <groupId>org.apache.maven.plugins</groupId>
721 <artifactId>maven-surefire-plugin</artifactId>
722 <version>3.0.0-M4</version>
724 <!-- Sets the VM argument line used when unit tests are run. -->
725 <reuseForks>false</reuseForks>
726 <forkCount>1</forkCount>
727 <environmentVariables>
728 <APP_HOME>.</APP_HOME>
729 <CONFIG_HOME>src/test/resources</CONFIG_HOME>
730 </environmentVariables>
731 <argLine>${surefireArgLine}</argLine>
732 <!-- Excludes integration tests when unit tests are run. -->
734 <exclude>**/IT*.java</exclude>
739 <groupId>org.apache.maven.plugins</groupId>
740 <artifactId>maven-failsafe-plugin</artifactId>
741 <version>3.0.0-M5</version>
743 <!-- Ensures that both integration-test and verify goals of the Failsafe
744 Maven plugin are executed. -->
746 <id>integration-tests</id>
748 <goal>integration-test</goal>
752 <!-- Sets the VM argument line used when integration tests are run. -->
753 <argLine>${failsafeArgLine}</argLine>
759 <groupId>org.sonarsource.scanner.maven</groupId>
760 <artifactId>sonar-maven-plugin</artifactId>
761 <version>${sonar.scanner.version}</version>
763 <!-- end removable sonar config, note the additional exclusion for babel above