Create 1.13.0 maven release
[aai/babel.git] / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3
4     ============LICENSE_START=======================================================
5     org.onap.aai
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
13
14           http://www.apache.org/licenses/LICENSE-2.0
15
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=========================================================
22 -->
23
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>
27
28         <parent>
29                 <groupId>org.onap.aai.aai-common</groupId>
30                 <artifactId>aai-parent</artifactId>
31                 <version>1.13.3</version>
32         </parent>
33
34         <groupId>org.onap.aai</groupId>
35         <artifactId>babel</artifactId>
36         <version>1.13.0-SNAPSHOT</version>
37         <packaging>jar</packaging>
38
39         <name>aai-babel</name>
40         <description>ONAP AAI Babel Microservice</description>
41
42         <properties>
43                 <!-- Spring boot version -->
44
45                 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
46                 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
47
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>
50
51                 <sonar.jacoco.reportPath />
52                 <sonar.jacoco.itReportPath />
53                 <sonar.jacoco.reportMissing.force.zero />
54
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 />
60
61                 <jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>
62
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>
66
67                 <sonar.scanner.version>3.7.0.1746</sonar.scanner.version>
68
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>
77
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>
86
87                 <!-- Dependency Versions -->
88                 <sdc.tosca.version>1.6.5</sdc.tosca.version>
89
90                 <aai.common.version>1.9.4</aai.common.version>
91                 <logback.core.version>1.2.11</logback.core.version>
92                 <groovy.version>3.0.13</groovy.version>
93                 <spring-cloud.version>2020.0.2</spring-cloud.version>
94
95                 <commons.compress.version>1.22</commons.compress.version>
96                 <commons.codec.version>1.15</commons.codec.version>
97
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>
101
102                 <aai-schema.version>1.12.3</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>
105
106                 <sdc.distribution.client.version>1.4.5</sdc.distribution.client.version>
107                 <!-- TODO: use xml-legacy -->
108                 <xmlunit.version>1.6</xmlunit.version>
109
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>
114
115         </properties>
116
117         <profiles>
118                 <!-- Docker profile to be used for building docker image and pushing to nexus -->
119                 <profile>
120                         <id>docker</id>
121                         <build>
122                                 <plugins>
123                                         <plugin>
124                                                 <groupId>org.codehaus.mojo</groupId>
125                                                 <artifactId>build-helper-maven-plugin</artifactId>
126                                                 <version>3.3.0</version>
127                                                 <executions>
128                                                         <execution>
129                                                                 <phase>pre-clean</phase>
130                                                                 <id>parse-version</id>
131                                                                 <goals>
132                                                                         <goal>parse-version</goal>
133                                                                 </goals>
134                                                         </execution>
135                                                 </executions>
136                                         </plugin>
137                                         <plugin>
138                                                 <groupId>org.codehaus.gmavenplus</groupId>
139                                                 <artifactId>gmavenplus-plugin</artifactId>
140                                                 <version>1.13.1</version>
141                                                 <executions>
142                                                         <execution>
143                                                                 <phase>pre-clean</phase>
144                                                                 <goals>
145                                                                         <goal>execute</goal>
146                                                                 </goals>
147                                                         </execution>
148                                                 </executions>
149                                                 <configuration>
150                                                         <scripts>
151                                                                 <script>
152                                                                         def userAaiBaseImage = session.userProperties['aai.base.image'];
153                                                                         def userAaiCommonVersion = session.userProperties['aai.base.image.version'];
154                                                                         if (userAaiCommonVersion != null) {
155                                                                                 project.properties['aai.base.image.version'] = userAaiCommonVersion;
156                                                                         }
157                                                                         if (userAaiBaseImage != null) {
158                                                                                 project.properties['aai.base.image'] = userAaiBaseImage;
159                                                                         }
160                                                                         log.info 'Base image flavour: ' + project.properties['aai.base.image'];
161                                                                         log.info 'Base image version: ' + project.properties['aai.base.image.version'];
162                                                                 </script>
163                                                         </scripts>
164                                                 </configuration>
165                                         </plugin>
166                                         <plugin>
167                                                 <groupId>io.fabric8</groupId>
168                                                 <artifactId>docker-maven-plugin</artifactId>
169                                                 <version>${docker.fabric.version}</version>
170                                                 <configuration>
171                                                         <verbose>true</verbose>
172                                                         <apiVersion>1.23</apiVersion>
173                                                         <images>
174                                                                 <image>
175                                                                         <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l</name>
176                                                                         <build>
177                                                                                 <filter>@</filter>
178                                                                                 <tags>
179                                                                                         <tag>latest</tag>
180                                                                                         <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
181                                                                                         <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
182                                                                                         <tag>${image.tag}</tag>
183                                                                                 </tags>
184                                                                                 <cleanup>try</cleanup>
185                                                                                 <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
186                                                                                 <assembly>
187                                                                                         <inline>
188                                                                                                 <fileSets>
189                                                                                                         <fileSet>
190                                                                                                                 <directory>${aai.build.directory}</directory>
191                                                                                                                 <outputDirectory>/${project.artifactId}</outputDirectory>
192                                                                                                         </fileSet>
193                                                                                                 </fileSets>
194                                                                                         </inline>
195                                                                                 </assembly>
196                                                                         </build>
197                                                                 </image>
198                                                         </images>
199                                                 </configuration>
200                                                 <executions>
201                                                         <execution>
202                                                                 <id>clean-images</id>
203                                                                 <phase>pre-clean</phase>
204                                                                 <goals>
205                                                                         <goal>remove</goal>
206                                                                 </goals>
207                                                                 <configuration>
208                                                                         <removeAll>true</removeAll>
209                                                                 </configuration>
210                                                         </execution>
211                                                         <execution>
212                                                                 <id>generate-images</id>
213                                                                 <phase>package</phase>
214                                                                 <goals>
215                                                                         <goal>build</goal>
216                                                                 </goals>
217                                                         </execution>
218                                                         <execution>
219                                                                 <id>push-images</id>
220                                                                 <phase>deploy</phase>
221                                                                 <goals>
222                                                                         <goal>push</goal>
223                                                                 </goals>
224                                                         </execution>
225                                                 </executions>
226                                         </plugin>
227                                 </plugins>
228                         </build>
229                 </profile>
230         </profiles>
231
232   <dependencies>
233     <dependency>
234       <groupId>org.springframework.boot</groupId>
235       <artifactId>spring-boot-starter-jetty</artifactId>
236     </dependency>
237     <dependency>
238       <groupId>org.springframework.boot</groupId>
239       <artifactId>spring-boot-starter-jersey</artifactId>
240       <exclusions>
241         <exclusion>
242           <groupId>org.springframework.boot</groupId>
243           <artifactId>spring-boot-starter-jetty</artifactId>
244         </exclusion>
245         <exclusion>
246           <groupId>org.springframework.boot</groupId>
247           <artifactId>spring-boot-starter-tomcat</artifactId>
248         </exclusion>
249       </exclusions>
250     </dependency>
251     <dependency>
252       <groupId>org.springframework.boot</groupId>
253       <artifactId>spring-boot-starter-web</artifactId>
254       <exclusions>
255         <exclusion>
256           <groupId>org.springframework.boot</groupId>
257           <artifactId>spring-boot-starter-jetty</artifactId>
258         </exclusion>
259         <exclusion>
260           <groupId>org.springframework.boot</groupId>
261           <artifactId>spring-boot-starter-tomcat</artifactId>
262         </exclusion>
263       </exclusions>
264     </dependency>
265     <dependency>
266       <groupId>org.springframework.boot</groupId>
267       <artifactId>spring-boot-starter-aop</artifactId>
268       <exclusions>
269         <exclusion>
270           <groupId>org.springframework.boot</groupId>
271           <artifactId>spring-boot-starter-tomcat</artifactId>
272         </exclusion>
273       </exclusions>
274     </dependency>
275     <dependency>
276       <groupId>org.onap.aai.logging-service</groupId>
277       <artifactId>common-logging</artifactId>
278     </dependency>
279     <dependency>
280       <groupId>ch.qos.logback</groupId>
281       <artifactId>logback-classic</artifactId>
282     </dependency>
283     <dependency>
284       <groupId>ch.qos.logback</groupId>
285       <artifactId>logback-core</artifactId>
286       <version>${logback.core.version}</version>
287     </dependency>
288     <dependency>
289       <groupId>commons-codec</groupId>
290       <artifactId>commons-codec</artifactId>
291       <version>${commons.codec.version}</version>
292     </dependency>
293     <dependency>
294       <groupId>org.apache.commons</groupId>
295       <artifactId>commons-compress</artifactId>
296       <version>${commons.compress.version}</version>
297     </dependency>
298     <dependency>
299       <groupId>org.apache.commons</groupId>
300       <artifactId>commons-lang3</artifactId>
301       <version>${commons.lang3.version}</version>
302     </dependency>
303     <dependency>
304       <groupId>javax.ws.rs</groupId>
305       <artifactId>javax.ws.rs-api</artifactId>
306       <version>${javax.ws.rs.version}</version>
307     </dependency>
308     <dependency>
309       <groupId>org.codehaus.groovy</groupId>
310       <artifactId>groovy</artifactId>
311       <version>${groovy.version}</version>
312     </dependency>
313     <dependency>
314       <groupId>org.onap.sdc.sdc-tosca</groupId>
315       <artifactId>sdc-tosca</artifactId>
316       <version>${sdc.tosca.version}</version>
317     </dependency>
318     <dependency>
319       <groupId>org.onap.aai</groupId>
320       <artifactId>rest-client</artifactId>
321     </dependency>
322
323     <!-- Testing -->
324     <dependency>
325       <groupId>org.springframework.boot</groupId>
326       <artifactId>spring-boot-starter-test</artifactId>
327       <scope>test</scope>
328     </dependency>
329     <dependency>
330       <groupId>org.onap.sdc.sdc-distribution-client</groupId>
331       <artifactId>sdc-distribution-client</artifactId>
332       <version>${sdc.distribution.client.version}</version>
333       <scope>test</scope>
334     </dependency>
335     <dependency>
336       <groupId>org.hamcrest</groupId>
337       <artifactId>hamcrest</artifactId>
338       <version>2.2</version>
339       <scope>test</scope>
340     </dependency>
341     <dependency>
342       <groupId>org.junit.jupiter</groupId>
343       <artifactId>junit-jupiter</artifactId>
344       <version>5.10.2</version>
345       <scope>test</scope>
346     </dependency>
347     <dependency>
348       <groupId>org.junit.jupiter</groupId>
349       <artifactId>junit-jupiter-api</artifactId>
350       <scope>test</scope>
351     </dependency>
352
353                 <dependency>
354                         <groupId>org.xmlunit</groupId>
355                         <artifactId>xmlunit-legacy</artifactId>
356                         <scope>test</scope>
357                 </dependency>
358                 <dependency>
359                         <groupId>javax.xml.bind</groupId>
360                         <artifactId>jaxb-api</artifactId>
361                 </dependency>
362                 <dependency>
363                         <groupId>javax.xml.ws</groupId>
364                         <artifactId>jaxws-api</artifactId>
365                 </dependency>
366                 <dependency>
367                         <groupId>com.sun.xml.bind</groupId>
368                         <artifactId>jaxb-core</artifactId>
369                 </dependency>
370                 <dependency>
371                         <groupId>com.sun.xml.bind</groupId>
372                         <artifactId>jaxb-impl</artifactId>
373                 </dependency>
374                 <dependency>
375                         <groupId>jakarta.activation</groupId>
376                         <artifactId>jakarta.activation-api</artifactId>
377                         <version>${jakarta.activation.version}</version>
378                 </dependency>
379                 <dependency>
380                         <groupId>org.springframework.cloud</groupId>
381                         <artifactId>spring-cloud-starter-sleuth</artifactId>
382                 </dependency>
383                 <dependency>
384                                 <groupId>org.springframework.cloud</groupId>
385                                 <artifactId>spring-cloud-sleuth-zipkin</artifactId>
386                 </dependency>
387                 <dependency>
388                         <groupId>org.projectlombok</groupId>
389                         <artifactId>lombok</artifactId>
390                         <version>1.18.32</version>
391                         <scope>provided</scope>
392                 </dependency>
393         </dependencies>
394         <dependencyManagement>
395                 <dependencies>
396                         <dependency>
397                                 <groupId>org.springframework.cloud</groupId>
398                                 <artifactId>spring-cloud-dependencies</artifactId>
399                                 <version>${spring-cloud.version}</version>
400                                 <type>pom</type>
401                                 <scope>import</scope>
402                         </dependency>
403                 </dependencies>
404         </dependencyManagement>
405         <build>
406                 <plugins>
407                         <plugin>
408                                 <groupId>org.springframework.boot</groupId>
409                                 <artifactId>spring-boot-maven-plugin</artifactId>
410                                 <version>${spring.boot.version}</version>
411                                 <configuration>
412                                         <jvmArguments>
413                                                 -DCONFIG_HOME=./appconfig-local
414                                                 -DAPP_HOME=.
415                                                 -Dtosca.mappings.config=./appconfig-local/tosca-mappings.json
416                                                 -DKEY_STORE_PASSWORD=${KEY_STORE_PASSWORD}
417                                         </jvmArguments>
418                                 </configuration>
419                                 <executions>
420                                         <execution>
421                                                 <goals>
422                                                         <goal>repackage</goal>
423                                                 </goals>
424                                         </execution>
425                                 </executions>
426                         </plugin>
427                         <plugin>
428                                 <groupId>org.apache.maven.plugins</groupId>
429                                 <artifactId>maven-dependency-plugin</artifactId>
430                                 <executions>
431                                         <execution>
432                                                 <id>unpack</id>
433                                                 <phase>initialize</phase>
434                                                 <goals>
435                                                         <goal>unpack</goal>
436                                                 </goals>
437                                                 <configuration>
438                                                         <artifactItems>
439                                                                 <artifactItem>
440                                                                         <groupId>${aai-schema.group.id}</groupId>
441                                                                         <artifactId>aai-schema</artifactId>
442                                                                         <version>${aai-schema.version}</version>
443                                                                         <type>jar</type>
444                                                                         <includes>${aai.schema.source.folder}/aai_schema_v**.xsd</includes>
445                                                                         <outputDirectory>${project.build.directory}/tmp</outputDirectory>
446                                                                 </artifactItem>
447                                                         </artifactItems>
448                                                 </configuration>
449                                         </execution>
450                                 </executions>
451                         </plugin>
452                         <plugin>
453                                 <groupId>org.apache.maven.plugins</groupId>
454                                 <artifactId>maven-antrun-plugin</artifactId>
455                                 <version>${antrun.version}</version>
456                                 <executions>
457                                         <execution>
458                                                 <id>Flatten XSDs</id>
459                                                 <phase>initialize</phase>
460                                                 <goals>
461                                                         <goal>run</goal>
462                                                 </goals>
463                                                 <configuration>
464                                                         <target>
465                                                                 <copy todir="${aai.schema.target.folder}" flatten="true">
466                                                                         <fileset dir="${project.build.directory}/tmp">
467                                                                                 <include name="**/*.xsd" />
468                                                                         </fileset>
469                                                                 </copy>
470                                                         </target>
471                                                 </configuration>
472                                         </execution>
473                                 </executions>
474                         </plugin>
475                         <plugin>
476                                 <groupId>org.jvnet.jaxb2.maven2</groupId>
477                                 <artifactId>maven-jaxb2-plugin</artifactId>
478                                 <version>${mvn.jaxb2.version}</version>
479                                 <executions>
480                                         <execution>
481                                                 <phase>process-sources</phase>
482                                                 <goals>
483                                                         <goal>generate</goal>
484                                                 </goals>
485                                         </execution>
486                                 </executions>
487                                 <configuration>
488                                         <schemaDirectory>${aai.schema.target.folder}</schemaDirectory>
489                                         <generatePackage>org.onap.aai.babel.xml.generator.xsd</generatePackage>
490                                         <generateDirectory>${project.build.directory}/generated-sources</generateDirectory>
491                                         <schemaIncludes>
492                                                 <include>aai_schema_latest.xsd</include>
493                                         </schemaIncludes>
494                                         <extension>true</extension>
495                                         <args>
496                                                 <arg>-Xannotate</arg>
497                                         </args>
498                                         <plugins>
499                                                 <plugin>
500                                                         <groupId>org.jvnet.jaxb2_commons</groupId>
501                                                         <artifactId>jaxb2-basics-annotate</artifactId>
502                                                         <version>0.6.4</version>
503                                                 </plugin>
504                                                 <!-- Add the dependencies with your annotations as 'plugins' below -->
505                                                 <plugin>
506                                                         <groupId>org.jvnet.jaxb2_commons</groupId>
507                                                         <artifactId>jaxb2-annotate-plugin-test-annox-annotations</artifactId>
508                                                         <version>1.0.0</version>
509                                                 </plugin>
510                                         </plugins>
511                                 </configuration>
512                         </plugin>
513                         <plugin>
514                                 <artifactId>exec-maven-plugin</artifactId>
515                                 <groupId>org.codehaus.mojo</groupId>
516                                 <version>1.5.0</version>
517                                 <executions>
518                                         <execution>
519                                                 <!-- Run our script to get latest xsd version -->
520                                                 <id>Get latest xsd version</id>
521                                                 <phase>generate-sources</phase>
522                                                 <goals>
523                                                         <goal>exec</goal>
524                                                 </goals>
525                                                 <configuration>
526                                                         <workingDirectory>${basedir}/scripts</workingDirectory>
527                                                         <executable>bash</executable>
528                                                         <commandlineArgs>get-latest-xsd-version.sh ${basedir}</commandlineArgs>
529                                                 </configuration>
530                                         </execution>
531                                 </executions>
532                         </plugin>
533                         <plugin>
534                                 <artifactId>maven-assembly-plugin</artifactId>
535                                 <configuration>
536                                         <descriptors>
537                                                 <descriptor>src/main/assembly/descriptor.xml</descriptor>
538                                         </descriptors>
539                                 </configuration>
540                                 <executions>
541                                         <execution>
542                                                 <id>make-assembly</id>
543                                                 <phase>package</phase>
544                                                 <goals>
545                                                         <goal>single</goal>
546                                                 </goals>
547                                         </execution>
548                                 </executions>
549                         </plugin>
550                         <plugin>
551                                 <groupId>com.mycila</groupId>
552                                 <artifactId>license-maven-plugin</artifactId>
553                                 <version>3.0</version>
554                                 <configuration>
555                                         <header>License.txt</header>
556                                         <includes>
557                                                 <include>src/main/java/**</include>
558                                                 <include>src/test/java/**</include>
559                                                 <include>pom.xml</include>
560                                         </includes>
561                                         <skipExistingHeaders>true</skipExistingHeaders>
562                                 </configuration>
563                                 <executions>
564                                         <execution>
565                                                 <goals>
566                                                         <!-- Set goal from "check" to "format" to auto update license headers -->
567                                                         <goal>check</goal>
568                                                 </goals>
569                                                 <phase>validate</phase>
570                                         </execution>
571                                 </executions>
572                         </plugin>
573                         <plugin>
574                                 <groupId>org.apache.maven.plugins</groupId>
575                                 <artifactId>maven-compiler-plugin</artifactId>
576                                 <version>${maven-compiler-plugin.version}</version>
577                                 <inherited>true</inherited>
578                                 <configuration>
579                                         <source>${maven-compiler-plugin.source}</source>
580                                         <target>${maven-compiler-plugin.target}</target>
581                                         <testSource>${maven-compiler-plugin.test.source}</testSource>
582                                         <testTarget>${maven-compiler-plugin.test.target}</testTarget>
583                                 </configuration>
584                         </plugin>
585                         <plugin>
586                                 <groupId>org.apache.maven.plugins</groupId>
587                                 <artifactId>maven-jar-plugin</artifactId>
588                                 <version>3.0.2</version>
589                                 <executions>
590                                         <execution>
591                                                 <phase>package</phase>
592                                                 <goals>
593                                                         <goal>jar</goal>
594                                                 </goals>
595                                                 <configuration>
596                                                         <classifier>client</classifier>
597                                                         <includes>
598                                                                 <include>**/babel/service/data/*</include>
599                                                         </includes>
600                                                 </configuration>
601                                         </execution>
602                                 </executions>
603                         </plugin>
604                         <plugin>
605                                 <groupId>org.apache.maven.plugins</groupId>
606                                 <artifactId>maven-deploy-plugin</artifactId>
607                                 <configuration>
608                                         <classifier>client</classifier>
609                                 </configuration>
610                         </plugin>
611
612
613                         <!-- once we connect aai-parent or oparent 3.0+ we can take out this
614                  whole section -->
615
616                         <plugin>
617                                 <groupId>org.jacoco</groupId>
618                                 <artifactId>jacoco-maven-plugin</artifactId>
619                                 <version>${jacoco-maven-plugin.version}</version>
620                                 <configuration>
621                                         <!-- Note: This exclusion list should match <sonar.exclusions> property
622                      above -->
623                                         <excludes>
624                                                 <exclude>**/gen/**</exclude>
625                                                 <exclude>**/generated-sources/**</exclude>
626                                                 <exclude>**/yang-gen/**</exclude>
627                                                 <exclude>**/pax/**</exclude>
628                                                 <exclude>org/onap/aai/babel/xml/generator/xsd/*</exclude>
629                                         </excludes>
630                                 </configuration>
631                                 <executions>
632                                         <!-- Prepares the property pointing to the JaCoCo runtime agent which
633                      is passed as VM argument when Maven the Surefire plugin is executed. -->
634                                         <execution>
635                                                 <id>pre-unit-test</id>
636                                                 <goals>
637                                                         <goal>prepare-agent</goal>
638                                                 </goals>
639                                                 <configuration>
640                                                         <!-- Sets the path to the file which contains the execution data
641                                  . -->
642                                                         <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
643                                                         <!-- Sets the name of the property containing the settings for JaCoCo
644                                  runtime agent. -->
645                                                         <propertyName>surefireArgLine</propertyName>
646                                                 </configuration>
647                                         </execution>
648                                         <!-- Ensures that the code coverage report for unit tests is created
649                      after unit tests have been run. -->
650                                         <execution>
651                                                 <id>post-unit-test</id>
652                                                 <phase>test</phase>
653                                                 <goals>
654                                                         <goal>report</goal>
655                                                 </goals>
656                                                 <configuration>
657                                                         <!-- Sets the path to the file which contains the execution data
658                                  . -->
659                                                         <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
660                                                         <!-- Sets the output directory for the code coverage report. -->
661                                                         <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
662                                                 </configuration>
663                                         </execution>
664                                         <execution>
665                                                 <id>pre-integration-test</id>
666                                                 <phase>pre-integration-test</phase>
667                                                 <goals>
668                                                         <goal>prepare-agent</goal>
669                                                 </goals>
670                                                 <configuration>
671                                                         <!-- Sets the path to the file which contains the execution data
672                                  . -->
673                                                         <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
674                                                         <!-- Sets the name of the property containing the settings for JaCoCo
675                                  runtime agent. -->
676                                                         <propertyName>failsafeArgLine</propertyName>
677                                                 </configuration>
678                                         </execution>
679                                         <!-- Ensures that the code coverage report for integration tests after
680                      integration tests have been run. -->
681                                         <execution>
682                                                 <id>post-integration-test</id>
683                                                 <phase>post-integration-test</phase>
684                                                 <goals>
685                                                         <goal>report</goal>
686                                                 </goals>
687                                                 <configuration>
688                                                         <!-- Sets the path to the file which contains the execution data
689                                  . -->
690                                                         <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
691                                                         <!-- Sets the output directory for the code coverage report. -->
692                                                         <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
693                                                 </configuration>
694                                         </execution>
695                                         <execution>
696                                                 <id>default-check</id>
697                                                 <goals>
698                                                         <goal>check</goal>
699                                                 </goals>
700                                                 <configuration>
701                                                         <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
702                                                         <rules>
703                                                                 <rule implementation="org.jacoco.maven.RuleConfiguration">
704                                                                         <element>BUNDLE</element>
705                                                                         <limits>
706                                                                                 <limit implementation="org.jacoco.report.check.Limit">
707                                                                                         <counter>LINE</counter>
708                                                                                         <value>COVEREDRATIO</value>
709                                                                                         <minimum>${jacoco.line.coverage.limit}</minimum>
710                                                                                 </limit>
711                                                                         </limits>
712                                                                 </rule>
713                                                         </rules>
714                                                 </configuration>
715                                         </execution>
716                                 </executions>
717                         </plugin>
718                         <plugin>
719                                 <groupId>org.apache.maven.plugins</groupId>
720                                 <artifactId>maven-surefire-plugin</artifactId>
721                                 <version>3.0.0-M4</version>
722                                 <configuration>
723                                         <!-- Sets the VM argument line used when unit tests are run. -->
724                                         <reuseForks>false</reuseForks>
725                                         <forkCount>1</forkCount>
726                                         <environmentVariables>
727                                                 <APP_HOME>.</APP_HOME>
728                                                 <CONFIG_HOME>src/test/resources</CONFIG_HOME>
729                                         </environmentVariables>
730                                         <argLine>${surefireArgLine}</argLine>
731                                         <!-- Excludes integration tests when unit tests are run. -->
732                                         <excludes>
733                                                 <exclude>**/IT*.java</exclude>
734                                         </excludes>
735                                 </configuration>
736                         </plugin>
737                         <plugin>
738                                 <groupId>org.apache.maven.plugins</groupId>
739                                 <artifactId>maven-failsafe-plugin</artifactId>
740                                 <version>3.0.0-M5</version>
741                                 <executions>
742                                         <!-- Ensures that both integration-test and verify goals of the Failsafe
743                      Maven plugin are executed. -->
744                                         <execution>
745                                                 <id>integration-tests</id>
746                                                 <goals>
747                                                         <goal>integration-test</goal>
748                                                         <goal>verify</goal>
749                                                 </goals>
750                                                 <configuration>
751                                                         <!-- Sets the VM argument line used when integration tests are run. -->
752                                                         <argLine>${failsafeArgLine}</argLine>
753                                                 </configuration>
754                                         </execution>
755                                 </executions>
756                         </plugin>
757                         <plugin>
758                                 <groupId>org.sonarsource.scanner.maven</groupId>
759                                 <artifactId>sonar-maven-plugin</artifactId>
760                                 <version>${sonar.scanner.version}</version>
761                         </plugin>
762                         <!-- end removable sonar config, note the additional exclusion for babel above -->
763                 </plugins>
764         </build>
765
766 </project>