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.oparent</groupId>
30 <artifactId>oparent</artifactId>
31 <version>2.0.0</version>
35 <groupId>org.onap.aai</groupId>
36 <artifactId>babel</artifactId>
37 <version>1.6.0-SNAPSHOT</version>
38 <packaging>jar</packaging>
40 <name>aai-babel</name>
41 <description>ONAP AAI Babel Microservice</description>
44 <!-- Spring boot version -->
45 <spring.boot.version>2.1.6.RELEASE</spring.boot.version>
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>
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>
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.5.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>
81 <dependencyManagement>
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>
92 </dependencyManagement>
95 <!-- Docker profile to be used for building docker image and pushing to nexus -->
101 <groupId>org.codehaus.mojo</groupId>
102 <artifactId>build-helper-maven-plugin</artifactId>
103 <version>3.0.0</version>
106 <phase>pre-clean</phase>
107 <id>parse-version</id>
109 <goal>parse-version</goal>
115 <groupId>org.codehaus.groovy.maven</groupId>
116 <artifactId>gmaven-plugin</artifactId>
117 <version>1.0</version>
120 <phase>pre-clean</phase>
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;
131 if (userAaiBaseImage != null) {
132 project.properties['aai.base.image'] = userAaiBaseImage;
134 log.info 'Base image flavour: ' + project.properties['aai.base.image'];
135 log.info 'Base image version: ' + project.properties['aai.base.image.version'];
142 <groupId>io.fabric8</groupId>
143 <artifactId>docker-maven-plugin</artifactId>
144 <version>${docker.fabric.version}</version>
146 <verbose>true</verbose>
147 <apiVersion>1.23</apiVersion>
150 <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l
156 <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
157 <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
159 <cleanup>try</cleanup>
160 <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
165 <directory>${aai.build.directory}</directory>
166 <outputDirectory>/${project.artifactId}</outputDirectory>
177 <id>clean-images</id>
178 <phase>pre-clean</phase>
183 <removeAll>true</removeAll>
187 <id>generate-images</id>
188 <phase>package</phase>
195 <phase>deploy</phase>
208 <groupId>org.springframework.boot</groupId>
209 <artifactId>spring-boot-starter-jetty</artifactId>
212 <groupId>org.springframework.boot</groupId>
213 <artifactId>spring-boot-starter-jersey</artifactId>
216 <groupId>org.springframework.boot</groupId>
217 <artifactId>spring-boot-starter-tomcat</artifactId>
222 <groupId>org.onap.aai.logging-service</groupId>
223 <artifactId>common-logging</artifactId>
224 <version>${common.logging.version}</version>
227 <groupId>ch.qos.logback</groupId>
228 <artifactId>logback-classic</artifactId>
229 <version>${logback.version}</version><!--$NO-MVN-MAN-VER$-->
232 <groupId>ch.qos.logback</groupId>
233 <artifactId>logback-core</artifactId>
234 <version>${logback.version}</version><!--$NO-MVN-MAN-VER$-->
237 <groupId>commons-codec</groupId>
238 <artifactId>commons-codec</artifactId>
241 <groupId>org.apache.commons</groupId>
242 <artifactId>commons-compress</artifactId>
243 <version>${commons.compress.version}</version>
246 <groupId>org.apache.commons</groupId>
247 <artifactId>commons-lang3</artifactId>
250 <groupId>javax.ws.rs</groupId>
251 <artifactId>javax.ws.rs-api</artifactId>
252 <version>${javax.ws.rs.version}</version>
255 <groupId>org.codehaus.groovy</groupId>
256 <artifactId>groovy</artifactId>
259 <groupId>org.onap.sdc.sdc-tosca</groupId>
260 <artifactId>sdc-tosca</artifactId>
261 <version>${sdc.tosca.version}</version>
264 <groupId>org.onap.aai</groupId>
265 <artifactId>rest-client</artifactId>
266 <version>${aai.rest.client.version}</version>
271 <groupId>org.springframework.boot</groupId>
272 <artifactId>spring-boot-starter-test</artifactId>
276 <groupId>org.onap.sdc.sdc-distribution-client</groupId>
277 <artifactId>sdc-distribution-client</artifactId>
278 <version>${sdc.distribution.client.version}</version>
282 <groupId>xmlunit</groupId>
283 <artifactId>xmlunit</artifactId>
284 <version>${xmlunit.version}</version>
292 <groupId>org.springframework.boot</groupId>
293 <artifactId>spring-boot-maven-plugin</artifactId>
294 <version>${spring.boot.version}</version>
297 -DCONFIG_HOME=./appconfig-local
299 -Dtosca.mappings.config=./appconfig-local/tosca-mappings.json
300 -DKEY_STORE_PASSWORD=${KEY_STORE_PASSWORD}
306 <goal>repackage</goal>
312 <groupId>org.apache.maven.plugins</groupId>
313 <artifactId>maven-dependency-plugin</artifactId>
317 <phase>initialize</phase>
324 <groupId>${aai-schema.group.id}</groupId>
325 <artifactId>aai-schema</artifactId>
326 <version>${aai-schema.version}</version>
328 <includes>${aai.schema.source.folder}/aai_schema_v**.xsd</includes>
329 <outputDirectory>${project.build.directory}/tmp</outputDirectory>
337 <groupId>org.apache.maven.plugins</groupId>
338 <artifactId>maven-antrun-plugin</artifactId>
339 <version>${antrun.version}</version>
342 <id>Flatten XSDs</id>
343 <phase>initialize</phase>
349 <copy todir="${aai.schema.target.folder}" flatten="true">
350 <fileset dir="${project.build.directory}/tmp">
351 <include name="**/*.xsd" />
360 <groupId>org.jvnet.jaxb2.maven2</groupId>
361 <artifactId>maven-jaxb2-plugin</artifactId>
362 <version>${mvn.jaxb2.version}</version>
365 <phase>process-sources</phase>
367 <goal>generate</goal>
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>
376 <include>aai_schema_latest.xsd</include>
378 <extension>true</extension>
380 <arg>-Xannotate</arg>
384 <groupId>org.jvnet.jaxb2_commons</groupId>
385 <artifactId>jaxb2-basics-annotate</artifactId>
386 <version>0.6.4</version>
388 <!-- Add the dependencies with your annotations as 'plugins' below -->
390 <groupId>org.jvnet.jaxb2_commons</groupId>
391 <artifactId>jaxb2-annotate-plugin-test-annox-annotations</artifactId>
392 <version>1.0.0</version>
398 <artifactId>exec-maven-plugin</artifactId>
399 <groupId>org.codehaus.mojo</groupId>
400 <version>1.5.0</version>
402 <execution><!-- Run our script to get latest xsd version -->
403 <id>Get latest xsd version</id>
404 <phase>generate-sources</phase>
409 <workingDirectory>${basedir}/scripts</workingDirectory>
410 <executable>bash</executable>
411 <commandlineArgs>get-latest-xsd-version.sh ${basedir}</commandlineArgs>
417 <artifactId>maven-assembly-plugin</artifactId>
420 <descriptor>src/main/assembly/descriptor.xml</descriptor>
425 <id>make-assembly</id>
426 <phase>package</phase>
434 <groupId>com.mycila</groupId>
435 <artifactId>license-maven-plugin</artifactId>
436 <version>3.0</version>
438 <header>License.txt</header>
440 <include>src/main/java/**</include>
441 <include>src/test/java/**</include>
442 <include>pom.xml</include>
444 <skipExistingHeaders>true</skipExistingHeaders>
449 <!-- Set goal from "check" to "format" to auto update license headers -->
452 <phase>validate</phase>
457 <groupId>org.apache.maven.plugins</groupId>
458 <artifactId>maven-surefire-plugin</artifactId>
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>
469 <groupId>org.apache.maven.plugins</groupId>
470 <artifactId>maven-jar-plugin</artifactId>
471 <version>3.0.2</version>
474 <phase>package</phase>
479 <classifier>client</classifier>
481 <include>**/babel/service/data/*</include>
488 <groupId>org.apache.maven.plugins</groupId>
489 <artifactId>maven-deploy-plugin</artifactId>
491 <classifier>client</classifier>
495 <groupId>org.jacoco</groupId>
496 <artifactId>jacoco-maven-plugin</artifactId>
499 <exclude>org/onap/aai/babel/xml/generator/xsd/*</exclude>
504 <id>default-check</id>
509 <dataFile>${jacoco.report.directory}/jacoco-ut.exec</dataFile>
511 <!-- implementation is needed only for Maven 2 -->
512 <rule implementation="org.jacoco.maven.RuleConfiguration">
513 <element>BUNDLE</element>
515 <limit implementation="org.jacoco.report.check.Limit">
516 <counter>LINE</counter>
517 <value>COVEREDRATIO</value>
518 <minimum>${jacoco.line.coverage.limit}</minimum>