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.9.4</version>
34 <groupId>org.onap.aai</groupId>
35 <artifactId>babel</artifactId>
36 <version>1.12.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.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 <aaf.version>2.7.4</aaf.version>
92 <logback.core.version>1.2.11</logback.core.version>
93 <groovy.version>3.0.13</groovy.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.1</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>
149 def userAaiBaseImage = session.userProperties['aai.base.image'];
150 def userAaiCommonVersion = session.userProperties['aai.base.image.version'];
151 if (userAaiCommonVersion != null) {
152 project.properties['aai.base.image.version'] = userAaiCommonVersion;
154 if (userAaiBaseImage != null) {
155 project.properties['aai.base.image'] = userAaiBaseImage;
157 log.info 'Base image flavour: ' + project.properties['aai.base.image'];
158 log.info 'Base image version: ' + project.properties['aai.base.image.version'];
165 <groupId>io.fabric8</groupId>
166 <artifactId>docker-maven-plugin</artifactId>
167 <version>${docker.fabric.version}</version>
169 <verbose>true</verbose>
170 <apiVersion>1.23</apiVersion>
173 <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l</name>
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>
284 <version>${logback.core.version}</version>
287 <groupId>commons-codec</groupId>
288 <artifactId>commons-codec</artifactId>
289 <version>${commons.codec.version}</version>
292 <groupId>org.apache.commons</groupId>
293 <artifactId>commons-compress</artifactId>
294 <version>${commons.compress.version}</version>
297 <groupId>org.apache.commons</groupId>
298 <artifactId>commons-lang3</artifactId>
299 <version>${commons.lang3.version}</version>
302 <groupId>javax.ws.rs</groupId>
303 <artifactId>javax.ws.rs-api</artifactId>
304 <version>${javax.ws.rs.version}</version>
307 <groupId>org.codehaus.groovy</groupId>
308 <artifactId>groovy</artifactId>
309 <version>${groovy.version}</version>
312 <groupId>org.onap.sdc.sdc-tosca</groupId>
313 <artifactId>sdc-tosca</artifactId>
314 <version>${sdc.tosca.version}</version>
317 <groupId>org.onap.aai</groupId>
318 <artifactId>rest-client</artifactId>
321 <groupId>org.onap.aai.aai-common</groupId>
322 <artifactId>aai-aaf-auth</artifactId>
323 <version>${aai.common.version}</version>
326 <groupId>org.springframework.boot</groupId>
327 <artifactId>spring-boot-starter-web</artifactId>
332 <groupId>org.onap.aaf.authz</groupId>
333 <artifactId>aaf-cadi-core</artifactId>
334 <version>${aaf.version}</version>
335 <scope>compile</scope>
338 <groupId>org.onap.aaf.authz</groupId>
339 <artifactId>aaf-cadi-aaf</artifactId>
340 <version>${aaf.version}</version>
341 <scope>compile</scope>
344 <groupId>org.onap.aaf.authz</groupId>
345 <artifactId>aaf-auth-client</artifactId>
346 <version>${aaf.version}</version>
349 <groupId>org.onap.aaf.authz</groupId>
350 <artifactId>aaf-cadi-client</artifactId>
351 <version>${aaf.version}</version>
354 <groupId>org.onap.aaf.authz</groupId>
355 <artifactId>aaf-misc-env</artifactId>
356 <version>${aaf.version}</version>
359 <groupId>org.onap.aaf.authz</groupId>
360 <artifactId>aaf-misc-rosetta</artifactId>
361 <version>${aaf.version}</version>
366 <groupId>org.springframework.boot</groupId>
367 <artifactId>spring-boot-starter-test</artifactId>
371 <groupId>org.onap.sdc.sdc-distribution-client</groupId>
372 <artifactId>sdc-distribution-client</artifactId>
373 <version>${sdc.distribution.client.version}</version>
377 <groupId>junit</groupId>
378 <artifactId>junit</artifactId>
379 <version>4.12</version>
384 <groupId>xmlunit</groupId>
385 <artifactId>xmlunit</artifactId>
386 <version>${xmlunit.version}</version>
390 <groupId>javax.xml.bind</groupId>
391 <artifactId>jaxb-api</artifactId>
394 <groupId>javax.xml.ws</groupId>
395 <artifactId>jaxws-api</artifactId>
398 <groupId>com.sun.xml.bind</groupId>
399 <artifactId>jaxb-core</artifactId>
402 <groupId>com.sun.xml.bind</groupId>
403 <artifactId>jaxb-impl</artifactId>
406 <groupId>jakarta.activation</groupId>
407 <artifactId>jakarta.activation-api</artifactId>
408 <version>${jakarta.activation.version}</version>
415 <groupId>org.springframework.boot</groupId>
416 <artifactId>spring-boot-maven-plugin</artifactId>
417 <version>${spring.boot.version}</version>
420 -DCONFIG_HOME=./appconfig-local
422 -Dtosca.mappings.config=./appconfig-local/tosca-mappings.json
423 -DKEY_STORE_PASSWORD=${KEY_STORE_PASSWORD}
429 <goal>repackage</goal>
435 <groupId>org.apache.maven.plugins</groupId>
436 <artifactId>maven-dependency-plugin</artifactId>
440 <phase>initialize</phase>
447 <groupId>${aai-schema.group.id}</groupId>
448 <artifactId>aai-schema</artifactId>
449 <version>${aai-schema.version}</version>
451 <includes>${aai.schema.source.folder}/aai_schema_v**.xsd</includes>
452 <outputDirectory>${project.build.directory}/tmp</outputDirectory>
460 <groupId>org.apache.maven.plugins</groupId>
461 <artifactId>maven-antrun-plugin</artifactId>
462 <version>${antrun.version}</version>
465 <id>Flatten XSDs</id>
466 <phase>initialize</phase>
472 <copy todir="${aai.schema.target.folder}" flatten="true">
473 <fileset dir="${project.build.directory}/tmp">
474 <include name="**/*.xsd" />
483 <groupId>org.jvnet.jaxb2.maven2</groupId>
484 <artifactId>maven-jaxb2-plugin</artifactId>
485 <version>${mvn.jaxb2.version}</version>
488 <phase>process-sources</phase>
490 <goal>generate</goal>
495 <schemaDirectory>${aai.schema.target.folder}</schemaDirectory>
496 <generatePackage>org.onap.aai.babel.xml.generator.xsd</generatePackage>
497 <generateDirectory>${project.build.directory}/generated-sources</generateDirectory>
499 <include>aai_schema_latest.xsd</include>
501 <extension>true</extension>
503 <arg>-Xannotate</arg>
507 <groupId>org.jvnet.jaxb2_commons</groupId>
508 <artifactId>jaxb2-basics-annotate</artifactId>
509 <version>0.6.4</version>
511 <!-- Add the dependencies with your annotations as 'plugins' below -->
513 <groupId>org.jvnet.jaxb2_commons</groupId>
514 <artifactId>jaxb2-annotate-plugin-test-annox-annotations</artifactId>
515 <version>1.0.0</version>
521 <artifactId>exec-maven-plugin</artifactId>
522 <groupId>org.codehaus.mojo</groupId>
523 <version>1.5.0</version>
526 <!-- Run our script to get latest xsd version -->
527 <id>Get latest xsd version</id>
528 <phase>generate-sources</phase>
533 <workingDirectory>${basedir}/scripts</workingDirectory>
534 <executable>bash</executable>
535 <commandlineArgs>get-latest-xsd-version.sh ${basedir}</commandlineArgs>
541 <artifactId>maven-assembly-plugin</artifactId>
544 <descriptor>src/main/assembly/descriptor.xml</descriptor>
549 <id>make-assembly</id>
550 <phase>package</phase>
558 <groupId>com.mycila</groupId>
559 <artifactId>license-maven-plugin</artifactId>
560 <version>3.0</version>
562 <header>License.txt</header>
564 <include>src/main/java/**</include>
565 <include>src/test/java/**</include>
566 <include>pom.xml</include>
568 <skipExistingHeaders>true</skipExistingHeaders>
573 <!-- Set goal from "check" to "format" to auto update license headers -->
576 <phase>validate</phase>
581 <groupId>org.apache.maven.plugins</groupId>
582 <artifactId>maven-compiler-plugin</artifactId>
583 <version>${maven-compiler-plugin.version}</version>
584 <inherited>true</inherited>
586 <source>${maven-compiler-plugin.source}</source>
587 <target>${maven-compiler-plugin.target}</target>
588 <testSource>${maven-compiler-plugin.test.source}</testSource>
589 <testTarget>${maven-compiler-plugin.test.target}</testTarget>
593 <groupId>org.apache.maven.plugins</groupId>
594 <artifactId>maven-jar-plugin</artifactId>
595 <version>3.0.2</version>
598 <phase>package</phase>
603 <classifier>client</classifier>
605 <include>**/babel/service/data/*</include>
612 <groupId>org.apache.maven.plugins</groupId>
613 <artifactId>maven-deploy-plugin</artifactId>
615 <classifier>client</classifier>
620 <!-- once we connect aai-parent or oparent 3.0+ we can take out this
624 <groupId>org.jacoco</groupId>
625 <artifactId>jacoco-maven-plugin</artifactId>
626 <version>${jacoco-maven-plugin.version}</version>
628 <!-- Note: This exclusion list should match <sonar.exclusions> property
631 <exclude>**/gen/**</exclude>
632 <exclude>**/generated-sources/**</exclude>
633 <exclude>**/yang-gen/**</exclude>
634 <exclude>**/pax/**</exclude>
635 <exclude>org/onap/aai/babel/xml/generator/xsd/*</exclude>
639 <!-- Prepares the property pointing to the JaCoCo runtime agent which
640 is passed as VM argument when Maven the Surefire plugin is executed. -->
642 <id>pre-unit-test</id>
644 <goal>prepare-agent</goal>
647 <!-- Sets the path to the file which contains the execution data
649 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
650 <!-- Sets the name of the property containing the settings for JaCoCo
652 <propertyName>surefireArgLine</propertyName>
655 <!-- Ensures that the code coverage report for unit tests is created
656 after unit tests have been run. -->
658 <id>post-unit-test</id>
664 <!-- Sets the path to the file which contains the execution data
666 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
667 <!-- Sets the output directory for the code coverage report. -->
668 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
672 <id>pre-integration-test</id>
673 <phase>pre-integration-test</phase>
675 <goal>prepare-agent</goal>
678 <!-- Sets the path to the file which contains the execution data
680 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
681 <!-- Sets the name of the property containing the settings for JaCoCo
683 <propertyName>failsafeArgLine</propertyName>
686 <!-- Ensures that the code coverage report for integration tests after
687 integration tests have been run. -->
689 <id>post-integration-test</id>
690 <phase>post-integration-test</phase>
695 <!-- Sets the path to the file which contains the execution data
697 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
698 <!-- Sets the output directory for the code coverage report. -->
699 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
703 <id>default-check</id>
708 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
710 <rule implementation="org.jacoco.maven.RuleConfiguration">
711 <element>BUNDLE</element>
713 <limit implementation="org.jacoco.report.check.Limit">
714 <counter>LINE</counter>
715 <value>COVEREDRATIO</value>
716 <minimum>${jacoco.line.coverage.limit}</minimum>
726 <groupId>org.apache.maven.plugins</groupId>
727 <artifactId>maven-surefire-plugin</artifactId>
728 <version>3.0.0-M4</version>
730 <!-- Sets the VM argument line used when unit tests are run. -->
731 <reuseForks>false</reuseForks>
732 <forkCount>1</forkCount>
733 <environmentVariables>
734 <APP_HOME>.</APP_HOME>
735 <CONFIG_HOME>src/test/resources</CONFIG_HOME>
736 </environmentVariables>
737 <argLine>${surefireArgLine}</argLine>
738 <!-- Excludes integration tests when unit tests are run. -->
740 <exclude>**/IT*.java</exclude>
745 <groupId>org.apache.maven.plugins</groupId>
746 <artifactId>maven-failsafe-plugin</artifactId>
747 <version>3.0.0-M5</version>
749 <!-- Ensures that both integration-test and verify goals of the Failsafe
750 Maven plugin are executed. -->
752 <id>integration-tests</id>
754 <goal>integration-test</goal>
758 <!-- Sets the VM argument line used when integration tests are run. -->
759 <argLine>${failsafeArgLine}</argLine>
765 <groupId>org.sonarsource.scanner.maven</groupId>
766 <artifactId>sonar-maven-plugin</artifactId>
767 <version>${sonar.scanner.version}</version>
769 <!-- end removable sonar config, note the additional exclusion for babel above -->