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.7.3</version>
34 <groupId>org.onap.aai</groupId>
35 <artifactId>babel</artifactId>
36 <version>1.8.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.line.coverage.limit>0.90</jacoco.line.coverage.limit>
57 <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
58 <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
59 <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
61 <sonar.scanner.version>3.7.0.1746</sonar.scanner.version>
63 <!-- docker related properties -->
64 <docker.fabric.version>0.28.0</docker.fabric.version>
65 <aai.docker.version>1.0.0</aai.docker.version>
66 <aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/
67 </aai.build.directory>
68 <aai.docker.namespace>onap</aai.docker.namespace>
69 <aai.base.image>alpine</aai.base.image>
70 <aai.base.image.version>1.6.0</aai.base.image.version>
72 <!-- Dependency Versions -->
73 <sdc.tosca.version>1.5.1</sdc.tosca.version>
75 <javax.ws.rs.version>2.1</javax.ws.rs.version>
76 <mvn.jaxb2.version>0.13.2</mvn.jaxb2.version>
77 <aai-schema.group.id>org.onap.aai.schema-service</aai-schema.group.id>
78 <aai-schema.version>1.7.6</aai-schema.version>
80 <sdc.distribution.client.version>1.3.0</sdc.distribution.client.version>
81 <xmlunit.version>1.6</xmlunit.version>
83 <antrun.version>1.8</antrun.version>
85 <javax.activation.version>1.1.1</javax.activation.version>
86 <!-- This will be used for the docker images as the default format of maven build has issues -->
87 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
92 <!-- Docker profile to be used for building docker image and pushing to nexus -->
98 <groupId>org.codehaus.mojo</groupId>
99 <artifactId>build-helper-maven-plugin</artifactId>
100 <version>3.0.0</version>
103 <phase>pre-clean</phase>
104 <id>parse-version</id>
106 <goal>parse-version</goal>
112 <groupId>org.codehaus.groovy.maven</groupId>
113 <artifactId>gmaven-plugin</artifactId>
114 <version>1.0</version>
117 <phase>pre-clean</phase>
123 def userAaiBaseImage = session.userProperties['aai.base.image'];
124 def userAaiCommonVersion = session.userProperties['aai.base.image.version'];
125 if (userAaiCommonVersion != null) {
126 project.properties['aai.base.image.version'] = userAaiCommonVersion;
128 if (userAaiBaseImage != null) {
129 project.properties['aai.base.image'] = userAaiBaseImage;
131 log.info 'Base image flavour: ' + project.properties['aai.base.image'];
132 log.info 'Base image version: ' + project.properties['aai.base.image.version'];
139 <groupId>io.fabric8</groupId>
140 <artifactId>docker-maven-plugin</artifactId>
141 <version>${docker.fabric.version}</version>
143 <verbose>true</verbose>
144 <apiVersion>1.23</apiVersion>
147 <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l
153 <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
154 <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
156 <cleanup>try</cleanup>
157 <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
162 <directory>${aai.build.directory}</directory>
163 <outputDirectory>/${project.artifactId}</outputDirectory>
174 <id>clean-images</id>
175 <phase>pre-clean</phase>
180 <removeAll>true</removeAll>
184 <id>generate-images</id>
185 <phase>package</phase>
192 <phase>deploy</phase>
205 <groupId>org.springframework.boot</groupId>
206 <artifactId>spring-boot-starter-jetty</artifactId>
209 <groupId>org.springframework.boot</groupId>
210 <artifactId>spring-boot-starter-jersey</artifactId>
213 <groupId>org.springframework.boot</groupId>
214 <artifactId>spring-boot-starter-tomcat</artifactId>
219 <groupId>org.onap.aai.logging-service</groupId>
220 <artifactId>common-logging</artifactId>
223 <groupId>ch.qos.logback</groupId>
224 <artifactId>logback-classic</artifactId>
227 <groupId>ch.qos.logback</groupId>
228 <artifactId>logback-core</artifactId>
231 <groupId>commons-codec</groupId>
232 <artifactId>commons-codec</artifactId>
235 <groupId>org.apache.commons</groupId>
236 <artifactId>commons-compress</artifactId>
239 <groupId>org.apache.commons</groupId>
240 <artifactId>commons-lang3</artifactId>
243 <groupId>javax.ws.rs</groupId>
244 <artifactId>javax.ws.rs-api</artifactId>
245 <version>2.1</version>
248 <groupId>org.codehaus.groovy</groupId>
249 <artifactId>groovy</artifactId>
252 <groupId>org.onap.sdc.sdc-tosca</groupId>
253 <artifactId>sdc-tosca</artifactId>
254 <version>${sdc.tosca.version}</version>
257 <groupId>org.onap.aai</groupId>
258 <artifactId>rest-client</artifactId>
263 <groupId>org.springframework.boot</groupId>
264 <artifactId>spring-boot-starter-test</artifactId>
268 <groupId>org.onap.sdc.sdc-distribution-client</groupId>
269 <artifactId>sdc-distribution-client</artifactId>
270 <version>${sdc.distribution.client.version}</version>
274 <groupId>xmlunit</groupId>
275 <artifactId>xmlunit</artifactId>
276 <version>${xmlunit.version}</version>
280 <groupId>javax.xml.bind</groupId>
281 <artifactId>jaxb-api</artifactId>
284 <groupId>com.sun.xml.bind</groupId>
285 <artifactId>jaxb-core</artifactId>
288 <groupId>com.sun.xml.bind</groupId>
289 <artifactId>jaxb-impl</artifactId>
292 <groupId>javax.activation</groupId>
293 <artifactId>activation</artifactId>
294 <version>${javax.activation.version}</version>
301 <groupId>org.springframework.boot</groupId>
302 <artifactId>spring-boot-maven-plugin</artifactId>
303 <version>${spring.boot.version}</version>
306 -DCONFIG_HOME=./appconfig-local
308 -Dtosca.mappings.config=./appconfig-local/tosca-mappings.json
309 -DKEY_STORE_PASSWORD=${KEY_STORE_PASSWORD}
315 <goal>repackage</goal>
321 <groupId>org.apache.maven.plugins</groupId>
322 <artifactId>maven-dependency-plugin</artifactId>
326 <phase>initialize</phase>
333 <groupId>${aai-schema.group.id}</groupId>
334 <artifactId>aai-schema</artifactId>
335 <version>${aai-schema.version}</version>
337 <includes>${aai.schema.source.folder}/aai_schema_v**.xsd</includes>
338 <outputDirectory>${project.build.directory}/tmp</outputDirectory>
346 <groupId>org.apache.maven.plugins</groupId>
347 <artifactId>maven-antrun-plugin</artifactId>
348 <version>${antrun.version}</version>
351 <id>Flatten XSDs</id>
352 <phase>initialize</phase>
358 <copy todir="${aai.schema.target.folder}" flatten="true">
359 <fileset dir="${project.build.directory}/tmp">
360 <include name="**/*.xsd" />
369 <groupId>org.jvnet.jaxb2.maven2</groupId>
370 <artifactId>maven-jaxb2-plugin</artifactId>
371 <version>${mvn.jaxb2.version}</version>
374 <phase>process-sources</phase>
376 <goal>generate</goal>
381 <schemaDirectory>${aai.schema.target.folder}</schemaDirectory>
382 <generatePackage>org.onap.aai.babel.xml.generator.xsd</generatePackage>
383 <generateDirectory>${project.build.directory}/generated-sources</generateDirectory>
385 <include>aai_schema_latest.xsd</include>
387 <extension>true</extension>
389 <arg>-Xannotate</arg>
393 <groupId>org.jvnet.jaxb2_commons</groupId>
394 <artifactId>jaxb2-basics-annotate</artifactId>
395 <version>0.6.4</version>
397 <!-- Add the dependencies with your annotations as 'plugins' below -->
399 <groupId>org.jvnet.jaxb2_commons</groupId>
400 <artifactId>jaxb2-annotate-plugin-test-annox-annotations</artifactId>
401 <version>1.0.0</version>
407 <artifactId>exec-maven-plugin</artifactId>
408 <groupId>org.codehaus.mojo</groupId>
409 <version>1.5.0</version>
411 <execution><!-- Run our script to get latest xsd version -->
412 <id>Get latest xsd version</id>
413 <phase>generate-sources</phase>
418 <workingDirectory>${basedir}/scripts</workingDirectory>
419 <executable>bash</executable>
420 <commandlineArgs>get-latest-xsd-version.sh ${basedir}</commandlineArgs>
426 <artifactId>maven-assembly-plugin</artifactId>
429 <descriptor>src/main/assembly/descriptor.xml</descriptor>
434 <id>make-assembly</id>
435 <phase>package</phase>
443 <groupId>com.mycila</groupId>
444 <artifactId>license-maven-plugin</artifactId>
445 <version>3.0</version>
447 <header>License.txt</header>
449 <include>src/main/java/**</include>
450 <include>src/test/java/**</include>
451 <include>pom.xml</include>
453 <skipExistingHeaders>true</skipExistingHeaders>
458 <!-- Set goal from "check" to "format" to auto update license headers -->
461 <phase>validate</phase>
466 <groupId>org.apache.maven.plugins</groupId>
467 <artifactId>maven-surefire-plugin</artifactId>
469 <reuseForks>false</reuseForks>
470 <forkCount>1</forkCount>
471 <environmentVariables>
472 <APP_HOME>.</APP_HOME>
473 <CONFIG_HOME>src/test/resources</CONFIG_HOME>
474 </environmentVariables>
478 <groupId>org.apache.maven.plugins</groupId>
479 <artifactId>maven-jar-plugin</artifactId>
480 <version>3.0.2</version>
483 <phase>package</phase>
488 <classifier>client</classifier>
490 <include>**/babel/service/data/*</include>
497 <groupId>org.apache.maven.plugins</groupId>
498 <artifactId>maven-deploy-plugin</artifactId>
500 <classifier>client</classifier>
505 <!-- once we connect aai-parent or oparent 3.0+ we can take out this
509 <groupId>org.jacoco</groupId>
510 <artifactId>jacoco-maven-plugin</artifactId>
511 <version>${jacoco.version}</version>
513 <!-- Note: This exclusion list should match <sonar.exclusions> property
516 <exclude>**/gen/**</exclude>
517 <exclude>**/generated-sources/**</exclude>
518 <exclude>**/yang-gen/**</exclude>
519 <exclude>**/pax/**</exclude>
520 <exclude>org/onap/aai/babel/xml/generator/xsd/*</exclude>
524 <!-- Prepares the property pointing to the JaCoCo runtime agent which
525 is passed as VM argument when Maven the Surefire plugin is executed. -->
527 <id>pre-unit-test</id>
529 <goal>prepare-agent</goal>
532 <!-- Sets the path to the file which contains the execution data
534 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
535 <!-- Sets the name of the property containing the settings for JaCoCo
537 <propertyName>surefireArgLine</propertyName>
540 <!-- Ensures that the code coverage report for unit tests is created
541 after unit tests have been run. -->
543 <id>post-unit-test</id>
549 <!-- Sets the path to the file which contains the execution data
551 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
552 <!-- Sets the output directory for the code coverage report. -->
553 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
557 <id>pre-integration-test</id>
558 <phase>pre-integration-test</phase>
560 <goal>prepare-agent</goal>
563 <!-- Sets the path to the file which contains the execution data
565 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
566 <!-- Sets the name of the property containing the settings for JaCoCo
568 <propertyName>failsafeArgLine</propertyName>
571 <!-- Ensures that the code coverage report for integration tests after
572 integration tests have been run. -->
574 <id>post-integration-test</id>
575 <phase>post-integration-test</phase>
580 <!-- Sets the path to the file which contains the execution data
582 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
583 <!-- Sets the output directory for the code coverage report. -->
584 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
588 <id>default-check</id>
593 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
595 <rule implementation="org.jacoco.maven.RuleConfiguration">
596 <element>BUNDLE</element>
598 <limit implementation="org.jacoco.report.check.Limit">
599 <counter>LINE</counter>
600 <value>COVEREDRATIO</value>
601 <minimum>${jacoco.line.coverage.limit}</minimum>
611 <groupId>org.apache.maven.plugins</groupId>
612 <artifactId>maven-surefire-plugin</artifactId>
613 <version>3.0.0-M4</version>
615 <!-- Sets the VM argument line used when unit tests are run. -->
616 <argLine>${surefireArgLine}</argLine>
617 <!-- Excludes integration tests when unit tests are run. -->
619 <exclude>**/IT*.java</exclude>
624 <groupId>org.apache.maven.plugins</groupId>
625 <artifactId>maven-failsafe-plugin</artifactId>
626 <version>3.0.0-M4</version>
628 <!-- Ensures that both integration-test and verify goals of the Failsafe
629 Maven plugin are executed. -->
631 <id>integration-tests</id>
633 <goal>integration-test</goal>
637 <!-- Sets the VM argument line used when integration tests are run. -->
638 <argLine>${failsafeArgLine}</argLine>
644 <groupId>org.sonarsource.scanner.maven</groupId>
645 <artifactId>sonar-maven-plugin</artifactId>
646 <version>${sonar.scanner.version}</version>
648 <!-- end removable sonar config, note the additional exclusion for babel above