1 <?xml version="1.0" encoding="UTF-8"?>
3 ============LICENSE_START=======================================================
5 ================================================================================
6 Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
7 Copyright © 2017-2018 European Software Marketing Ltd.
8 ================================================================================
9 Licensed under the Apache License, Version 2.0 (the "License");
10 you may not use this file except in compliance with the License.
11 You may obtain a copy of the License at
13 http://www.apache.org/licenses/LICENSE-2.0
15 Unless required by applicable law or agreed to in writing, software
16 distributed under the License is distributed on an "AS IS" BASIS,
17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 See the License for the specific language governing permissions and
19 limitations under the License.
20 ============LICENSE_END=========================================================
22 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24 <modelVersion>4.0.0</modelVersion>
27 <groupId>org.onap.oparent</groupId>
28 <artifactId>oparent</artifactId>
29 <version>2.1.0</version>
33 <groupId>org.onap.aai.model-loader</groupId>
34 <artifactId>model-loader</artifactId>
35 <name>aai-model-loader</name>
36 <version>1.7.0-SNAPSHOT</version>
38 <dependencyManagement>
41 <groupId>org.springframework.boot</groupId>
42 <artifactId>spring-boot-dependencies</artifactId>
43 <version>${spring-boot.version}</version>
48 </dependencyManagement>
51 <start-class>org.onap.aai.modelloader.service.ModelLoaderApplication</start-class>
52 <nexusproxy>https://nexus.onap.org</nexusproxy>
53 <docker.location>${basedir}/target</docker.location>
54 <spring-boot.version>2.1.12.RELEASE</spring-boot.version>
55 <apache.commons-text.version>1.8</apache.commons-text.version>
56 <commons-compress.version>1.19</commons-compress.version>
57 <hamcrest-all.version>1.3</hamcrest-all.version>
58 <babel.version>1.6.2</babel.version>
59 <aai.rest.client.version>1.2.1</aai.rest.client.version>
60 <sdc-distribution-client.version>1.3.0</sdc-distribution-client.version>
61 <logback.version>1.2.3</logback.version>
62 <!-- docker related properties -->
63 <docker.fabric.version>0.28.0</docker.fabric.version>
64 <aai.docker.version>1.0.0</aai.docker.version>
65 <aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/</aai.build.directory>
66 <aai.docker.namespace>onap</aai.docker.namespace>
67 <aai.base.image>alpine</aai.base.image>
68 <aai.base.image.version>1.6.0</aai.base.image.version>
69 <!-- This will be used for the docker images as the default format of maven build has issues -->
70 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
72 <sonar.jacoco.reportPath />
73 <sonar.jacoco.itReportPath />
74 <sonar.jacoco.reportMissing.force.zero />
76 <jacoco.line.coverage.limit>0.75</jacoco.line.coverage.limit>
77 <jacoco.version>0.8.5</jacoco.version>
78 <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
79 <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
80 <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
81 <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
83 <sonar.scanner.version>3.7.0.1746</sonar.scanner.version>
87 <distributionManagement>
89 <id>ecomp-releases</id>
90 <name>ECOMP Release Repository</name>
91 <url>${nexusproxy}/content/repositories/releases/</url>
94 <id>ecomp-snapshots</id>
95 <name>ECOMP Snapshot Repository</name>
96 <url>${nexusproxy}/content/repositories/snapshots/</url>
98 </distributionManagement>
101 <!-- Docker profile to be used for building docker image and pushing to nexus -->
107 <groupId>org.codehaus.mojo</groupId>
108 <artifactId>build-helper-maven-plugin</artifactId>
109 <version>3.0.0</version>
112 <phase>pre-clean</phase>
113 <id>parse-version</id>
115 <goal>parse-version</goal>
121 <groupId>org.codehaus.groovy.maven</groupId>
122 <artifactId>gmaven-plugin</artifactId>
123 <version>1.0</version>
126 <phase>pre-clean</phase>
132 def userAaiBaseImage = session.userProperties['aai.base.image'];
133 def userAaiCommonVersion = session.userProperties['aai.base.image.version'];
134 if (userAaiCommonVersion != null) {
135 project.properties['aai.base.image.version'] = userAaiCommonVersion;
137 if (userAaiBaseImage != null) {
138 project.properties['aai.base.image'] = userAaiBaseImage;
140 log.info 'Base image flavour: ' + project.properties['aai.base.image'];
141 log.info 'Base image version: ' + project.properties['aai.base.image.version'];
148 <groupId>io.fabric8</groupId>
149 <artifactId>docker-maven-plugin</artifactId>
150 <version>${docker.fabric.version}</version>
152 <verbose>true</verbose>
153 <apiVersion>1.23</apiVersion>
156 <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l</name>
161 <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
162 <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
164 <cleanup>try</cleanup>
165 <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
170 <directory>${aai.build.directory}</directory>
171 <outputDirectory>/${project.artifactId}</outputDirectory>
182 <id>clean-images</id>
183 <phase>pre-clean</phase>
188 <removeAll>true</removeAll>
192 <id>generate-images</id>
193 <phase>package</phase>
200 <phase>deploy</phase>
214 <groupId>org.springframework.boot</groupId>
215 <artifactId>spring-boot-starter-jetty</artifactId>
218 <groupId>org.springframework.boot</groupId>
219 <artifactId>spring-boot-starter-web</artifactId>
222 <groupId>org.springframework.boot</groupId>
223 <artifactId>spring-boot-starter-tomcat</artifactId>
228 <groupId>org.onap.aai</groupId>
229 <artifactId>babel</artifactId>
230 <version>${babel.version}</version>
231 <classifier>client</classifier>
235 <artifactId>*</artifactId>
240 <groupId>org.glassfish.jersey.core</groupId>
241 <artifactId>jersey-common</artifactId>
245 <groupId>org.onap.aai</groupId>
246 <artifactId>rest-client</artifactId>
247 <version>${aai.rest.client.version}</version>
250 <groupId>com.google.code.gson</groupId>
251 <artifactId>gson</artifactId>
254 <!-- Test dependencies -->
255 <!-- https://mvnrepository.com/artifact/com.mikesamuel/json-sanitizer -->
257 <groupId>com.mikesamuel</groupId>
258 <artifactId>json-sanitizer</artifactId>
259 <version>1.2.0</version>
262 <!-- Common logging framework -->
264 <groupId>org.onap.aai.logging-service</groupId>
265 <artifactId>common-logging</artifactId>
266 <version>1.5.0</version>
269 <groupId>ch.qos.logback</groupId>
270 <artifactId>logback-classic</artifactId>
271 <version>${logback.version}</version><!--$NO-MVN-MAN-VER$ -->
274 <groupId>ch.qos.logback</groupId>
275 <artifactId>logback-core</artifactId>
276 <version>${logback.version}</version><!--$NO-MVN-MAN-VER$ -->
279 <groupId>org.onap.sdc.sdc-distribution-client</groupId>
280 <artifactId>sdc-distribution-client</artifactId>
281 <version>${sdc-distribution-client.version}</version>
284 <groupId>org.json</groupId>
285 <artifactId>json</artifactId>
286 <version>20131018</version><!--$NO-MVN-MAN-VER$ -->
289 <groupId>org.eclipse.jetty</groupId>
290 <artifactId>jetty-security</artifactId>
293 <groupId>jline</groupId>
294 <artifactId>jline</artifactId>
295 <version>2.12.1</version>
298 <groupId>org.apache.commons</groupId>
299 <artifactId>commons-compress</artifactId>
300 <version>${commons-compress.version}</version>
303 <groupId>commons-io</groupId>
304 <artifactId>commons-io</artifactId>
305 <version>2.4</version>
308 <groupId>org.apache.commons</groupId>
309 <artifactId>commons-text</artifactId>
310 <version>${apache.commons-text.version}</version>
313 <!-- Test dependencies -->
315 <groupId>junit</groupId>
316 <artifactId>junit</artifactId>
320 <groupId>org.hamcrest</groupId>
321 <artifactId>hamcrest-all</artifactId>
322 <version>${hamcrest-all.version}</version>
326 <groupId>org.mockito</groupId>
327 <artifactId>mockito-core</artifactId>
331 <groupId>org.springframework.boot</groupId>
332 <artifactId>spring-boot-starter-test</artifactId>
337 <!-- Plugins and repositories -->
341 <url>http://repo1.maven.org/maven2</url>
345 <name>EvoSuite Repository</name>
346 <url>http://www.evosuite.org/m2</url>
348 </pluginRepositories>
353 <name>Maven 2 repository 2</name>
354 <url>http://repo2.maven.org/maven2/</url>
357 <id>ecomp-releases</id>
358 <name>ECOMP Release Repository</name>
359 <url>${nexusproxy}/content/repositories/releases/</url>
362 <id>ecomp-snapshots</id>
363 <name>ECOMP Snapshot Repository</name>
364 <url>${nexusproxy}/content/repositories/snapshots/</url>
367 <id>ecomp-staging</id>
368 <name>ECOMP Staging Repository</name>
369 <url>${nexusproxy}/content/repositories/staging/</url>
376 <groupId>org.springframework.boot</groupId>
377 <artifactId>spring-boot-maven-plugin</artifactId>
378 <version>${spring-boot.version}</version>
380 <executable>true</executable>
385 <goal>repackage</goal>
391 <groupId>com.mycila</groupId>
392 <artifactId>license-maven-plugin</artifactId>
393 <version>3.0</version>
395 <header>License.txt</header>
397 <include>src/main/java/**</include>
398 <include>src/test/java/**</include>
399 <include>version/properties</include>
400 <include>pom.xml</include>
402 <skipExistingHeaders>true</skipExistingHeaders>
407 <!-- Set goal to "format" to auto update license headers -->
410 <phase>process-sources</phase>
415 <groupId>org.apache.maven.plugins</groupId>
416 <artifactId>maven-deploy-plugin</artifactId>
418 <classifier>client</classifier>
422 <artifactId>maven-assembly-plugin</artifactId>
425 <descriptor>src/main/assembly/descriptor.xml</descriptor>
430 <id>make-assembly</id>
431 <phase>package</phase>
439 <!-- once we connect aai-parent or oparent 3.0+ we can take out this
443 <groupId>org.jacoco</groupId>
444 <artifactId>jacoco-maven-plugin</artifactId>
445 <version>${jacoco.version}</version>
447 <!-- Note: This exclusion list should match <sonar.exclusions> property
450 <exclude>**/gen/**</exclude>
451 <exclude>**/generated-sources/**</exclude>
452 <exclude>**/yang-gen/**</exclude>
453 <exclude>**/pax/**</exclude>
457 <!-- Prepares the property pointing to the JaCoCo runtime agent which
458 is passed as VM argument when Maven the Surefire plugin is executed. -->
460 <id>pre-unit-test</id>
462 <goal>prepare-agent</goal>
465 <!-- Sets the path to the file which contains the execution data
467 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
468 <!-- Sets the name of the property containing the settings for JaCoCo
470 <propertyName>surefireArgLine</propertyName>
473 <!-- Ensures that the code coverage report for unit tests is created
474 after unit tests have been run. -->
476 <id>post-unit-test</id>
482 <!-- Sets the path to the file which contains the execution data
484 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
485 <!-- Sets the output directory for the code coverage report. -->
486 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
490 <id>pre-integration-test</id>
491 <phase>pre-integration-test</phase>
493 <goal>prepare-agent</goal>
496 <!-- Sets the path to the file which contains the execution data
498 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
499 <!-- Sets the name of the property containing the settings for JaCoCo
501 <propertyName>failsafeArgLine</propertyName>
504 <!-- Ensures that the code coverage report for integration tests after
505 integration tests have been run. -->
507 <id>post-integration-test</id>
508 <phase>post-integration-test</phase>
513 <!-- Sets the path to the file which contains the execution data
515 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
516 <!-- Sets the output directory for the code coverage report. -->
517 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
521 <id>default-check</id>
526 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
528 <rule implementation="org.jacoco.maven.RuleConfiguration">
529 <element>BUNDLE</element>
531 <limit implementation="org.jacoco.report.check.Limit">
532 <counter>LINE</counter>
533 <value>COVEREDRATIO</value>
534 <minimum>${jacoco.line.coverage.limit}</minimum>
544 <groupId>org.apache.maven.plugins</groupId>
545 <artifactId>maven-surefire-plugin</artifactId>
546 <version>3.0.0-M4</version>
548 <!-- Sets the VM argument line used when unit tests are run. -->
549 <argLine>${surefireArgLine}</argLine>
550 <!-- Excludes integration tests when unit tests are run. -->
552 <exclude>**/IT*.java</exclude>
557 <groupId>org.apache.maven.plugins</groupId>
558 <artifactId>maven-failsafe-plugin</artifactId>
559 <version>3.0.0-M4</version>
561 <!-- Ensures that both integration-test and verify goals of the Failsafe
562 Maven plugin are executed. -->
564 <id>integration-tests</id>
566 <goal>integration-test</goal>
570 <!-- Sets the VM argument line used when integration tests are run. -->
571 <argLine>${failsafeArgLine}</argLine>
577 <groupId>org.sonarsource.scanner.maven</groupId>
578 <artifactId>sonar-maven-plugin</artifactId>
579 <version>${sonar.scanner.version}</version>
581 <!-- end removable sonar config -->