Sonar - activate code coverage
[externalapi/nbi.git] / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3
4
5         Copyright (c) 2017 Orange.  All rights reserved.
6
7         Licensed under the Apache License, Version 2.0 (the "License");
8         you may not use this file except in compliance with the License.
9         You may obtain a copy of the License at
10
11             http://www.apache.org/licenses/LICENSE-2.0
12
13         Unless required by applicable law or agreed to in writing, software
14         distributed under the License is distributed on an "AS IS" BASIS,
15         WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16         See the License for the specific language governing permissions and
17         limitations under the License.
18
19 -->
20 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21                  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22         <modelVersion>4.0.0</modelVersion>
23
24         <groupId>org.onap.externalapi-nbi</groupId>
25         <artifactId>nbi-rest-services</artifactId>
26         <version>1.0.0-SNAPSHOT</version>
27         <packaging>jar</packaging>
28
29         <name>nbi-rest-services</name>
30
31         <parent>
32                 <groupId>org.springframework.boot</groupId>
33                 <artifactId>spring-boot-starter-parent</artifactId>
34                 <version>1.5.10.RELEASE</version>
35                 <relativePath /> <!-- lookup parent from repository -->
36         </parent>
37
38         <properties>
39                 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
40                 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
41                 <nexusproxy>https://nexus.onap.org</nexusproxy>
42                 <snapshotNexusPath>content/repositories/snapshots/</snapshotNexusPath>
43                 <releaseNexusPath>content/repositories/releases/</releaseNexusPath>
44                 <stagingNexusPath>content/repositories/staging/</stagingNexusPath>
45                 <java.version>1.8</java.version>
46                 <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
47                 <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
48                 <timestamp>${maven.build.timestamp}</timestamp>
49                 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
50                 <!--docker -->
51                 <docker.tag>${project.version}-${timestamp}</docker.tag>
52                 <docker.latest.tag>${project.version}-latest</docker.latest.tag>
53                 <!--sonar -->
54              <sonar.language>java</sonar.language>
55              <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
56              <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
57              <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec</sonar.jacoco.reportPath>
58              <sonar.jacoco.itReportPath>${project.build.directory}/coverage-reports/jacoco-it.exec</sonar.jacoco.itReportPath>
59              <sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>
60              <sonar.projectVersion>${project.version}</sonar.projectVersion>
61                 <sonar.coverage.exclusions>**/model/**/*</sonar.coverage.exclusions>
62         </properties>
63
64         <repositories>
65                 <repository>
66                         <id>maven2-repository.java.net</id>
67                         <name>Java.net Repository for Maven</name>
68                         <url>http://download.java.net/maven/2/</url>
69                         <layout>default</layout>
70                 </repository>
71                 <repository>
72                         <id>ecomp-snapshots</id>
73                         <name>Snapshot Repository</name>
74                         <url>https://nexus.onap.org/content/repositories/releases/</url>
75                 </repository>
76                 <repository>
77                         <id>ecomp-staging</id>
78                         <name>Staging Repository</name>
79                         <url>https://nexus.onap.org/content/repositories/staging/</url>
80                 </repository>
81         </repositories>
82
83         <distributionManagement>
84                 <repository>
85                         <id>ecomp-releases</id>
86                         <name>Release Repository</name>
87                         <url>${nexusproxy}/${releaseNexusPath}</url>
88                 </repository>
89                 <snapshotRepository>
90                         <id>ecomp-snapshots</id>
91                         <name>Snapshot Repository</name>
92                         <url>${nexusproxy}/${snapshotNexusPath}</url>
93                 </snapshotRepository>
94         </distributionManagement>
95
96         <licenses>
97                 <license>
98                         <name>Apache2</name>
99                         <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
100                 </license>
101         </licenses>
102
103         <dependencies>
104
105                 <dependency>
106                         <groupId>org.springframework.boot</groupId>
107                         <artifactId>spring-boot-starter-web</artifactId>
108                 </dependency>
109
110                 <dependency>
111                         <groupId>org.springframework.boot</groupId>
112                         <artifactId>spring-boot-starter-data-jpa</artifactId>
113                 </dependency>
114
115                 <dependency>
116                         <groupId>org.apache.commons</groupId>
117                         <artifactId>commons-io</artifactId>
118                         <version>1.3.2</version>
119                 </dependency>
120
121                 <dependency>
122                         <groupId>commons-beanutils</groupId>
123                         <artifactId>commons-beanutils</artifactId>
124                         <version>1.9.3</version>
125                 </dependency>
126
127                 <dependency>
128                         <groupId>javax.validation</groupId>
129                         <artifactId>validation-api</artifactId>
130                         <version>2.0.1.Final</version>
131                 </dependency>
132
133                 <dependency>
134                         <groupId>org.apache.commons</groupId>
135                         <artifactId>commons-lang3</artifactId>
136                         <version>3.4</version>
137                 </dependency>
138
139                 <!-- mongo -->
140
141                 <dependency>
142                         <groupId>org.springframework.boot</groupId>
143                         <artifactId>spring-boot-starter-data-mongodb</artifactId>
144                 </dependency>
145
146                 <!-- mysql -->
147
148                 <dependency>
149                         <groupId>mysql</groupId>
150                         <artifactId>mysql-connector-java</artifactId>
151                 </dependency>
152                 <dependency>
153                         <groupId>org.mariadb.jdbc</groupId>
154                         <artifactId>mariadb-java-client</artifactId>
155                         <version>1.1.7</version>
156                 </dependency>
157
158                 <!-- swagger -->
159
160                 <dependency>
161                         <groupId>io.swagger</groupId>
162                         <artifactId>swagger-annotations</artifactId>
163                         <version>1.5.18</version>
164                 </dependency>
165
166                 <!-- jackson -->
167
168                 <dependency>
169                         <groupId>com.fasterxml.jackson.dataformat</groupId>
170                         <artifactId>jackson-dataformat-yaml</artifactId>
171                         <version>2.8.0</version>
172                 </dependency>
173
174                 <!-- jolt -->
175
176                 <dependency>
177                         <groupId>com.bazaarvoice.jolt</groupId>
178                         <artifactId>jolt-core</artifactId>
179                         <version>0.1.0</version>
180                         <exclusions>
181                                 <exclusion>
182                                         <groupId>com.fasterxml.jackson.core</groupId>
183                                         <artifactId>jackson-databind</artifactId>
184                                 </exclusion>
185                         </exclusions>
186                 </dependency>
187
188                 <dependency>
189                         <groupId>com.bazaarvoice.jolt</groupId>
190                         <artifactId>json-utils</artifactId>
191                         <version>0.1.0</version>
192                 </dependency>
193
194                 <!-- test -->
195
196                 <dependency>
197                         <groupId>org.springframework.boot</groupId>
198                         <artifactId>spring-boot-starter-test</artifactId>
199                         <scope>test</scope>
200                 </dependency>
201
202                 <!-- test h2 -->
203
204                 <dependency>
205                         <groupId>com.h2database</groupId>
206                         <artifactId>h2</artifactId>
207                         <scope>test</scope>
208                 </dependency>
209
210                 <dependency>
211                         <groupId>de.flapdoodle.embed</groupId>
212                         <artifactId>de.flapdoodle.embed.mongo</artifactId>
213                         <version>${embedded-mongo.version}</version>
214                         <scope>test</scope>
215                 </dependency>
216
217                 <!-- test wiremock -->
218
219                 <dependency>
220                         <groupId>org.springframework.cloud</groupId>
221                         <artifactId>spring-cloud-contract-wiremock</artifactId>
222                         <version>1.0.0.RELEASE</version>
223                         <scope>test</scope>
224                 </dependency>
225
226                 <dependency>
227                         <groupId>org.eclipse.jetty</groupId>
228                         <artifactId>jetty-server</artifactId>
229                         <version>9.4.7.RC0</version>
230                         <scope>test</scope>
231                 </dependency>
232
233                 <dependency>
234                         <groupId>org.eclipse.jetty</groupId>
235                         <artifactId>jetty-servlet</artifactId>
236                         <scope>test</scope>
237                 </dependency>
238
239                 <dependency>
240                         <groupId>org.eclipse.jetty</groupId>
241                         <artifactId>jetty-servlets</artifactId>
242                         <scope>test</scope>
243                 </dependency>
244
245                 <!-- runtime dev -->
246
247                 <dependency>
248                         <groupId>org.springframework.boot</groupId>
249                         <artifactId>spring-boot-devtools</artifactId>
250                         <scope>runtime</scope>
251                 </dependency>
252
253         </dependencies>
254
255         <build>
256                 <plugins>
257                         <plugin>
258                                 <groupId>org.springframework.boot</groupId>
259                                 <artifactId>spring-boot-maven-plugin</artifactId>
260                         </plugin>
261                         <plugin>
262                                 <groupId>org.sonatype.plugins</groupId>
263                                 <artifactId>nexus-staging-maven-plugin</artifactId>
264                                 <version>1.6.7</version>
265                                 <extensions>true</extensions>
266                                 <configuration>
267                                         <nexusUrl>${nexusproxy}</nexusUrl>
268                                         <stagingProfileId>176c31dfe190a</stagingProfileId>
269                                         <serverId>ecomp-staging</serverId>
270                                 </configuration>
271                         </plugin>
272                         <plugin>
273                                 <groupId>org.apache.maven.plugins</groupId>
274                                 <artifactId>maven-site-plugin</artifactId>
275                                 <version>3.6</version>
276                                 <dependencies>
277                                         <dependency>
278                                                 <groupId>org.apache.maven.wagon</groupId>
279                                                 <artifactId>wagon-webdav-jackrabbit</artifactId>
280                                                 <version>2.10</version>
281                                         </dependency>
282                                 </dependencies>
283                         </plugin>
284                         <plugin>
285                                 <groupId>com.mycila</groupId>
286                                 <artifactId>license-maven-plugin</artifactId>
287                                 <version>3.0</version>
288                                 <configuration>
289                                         <header>LICENSE.TXT</header>
290                                         <includes>
291                                                 <include>restclient/**</include>
292                                                 <include>src/**</include>
293                                                 <include>pom.xml</include>
294                                         </includes>
295                                         <skipExistingHeaders>true</skipExistingHeaders>
296                                         <skip>false</skip>
297                                         <mapping>
298                                                 <http>SCRIPT_STYLE</http>
299                                         </mapping>
300                                 </configuration>
301                                 <executions>
302                                         <execution>
303                                                 <goals>
304                                                         <!-- Set goal to "format" to auto update license headers -->
305                                                         <goal>check</goal>
306                                                 </goals>
307                                                 <phase>process-sources</phase>
308                                         </execution>
309                                 </executions>
310                         </plugin>
311                         <plugin>
312                                 <groupId>org.codehaus.mojo</groupId>
313                                 <artifactId>sonar-maven-plugin</artifactId>
314                                 <version>3.2</version>
315                         </plugin>
316                         <plugin>
317                              <groupId>org.jacoco</groupId>
318                              <artifactId>jacoco-maven-plugin</artifactId>
319                              <version>0.7.7.201606060606</version>
320                              <configuration>
321                                   <dumpOnExit>true</dumpOnExit>
322                                   <includes>
323                                         <include>org.onap.nbi.*</include>
324                                   </includes>
325                                   <excludes>
326                                         <exclude>**/model/**/*</exclude>
327                                   </excludes>        
328                              </configuration>
329                              <executions>
330                                   <execution>
331                                         <id>pre-unit-test</id>
332                                         <goals>
333                                              <goal>prepare-agent</goal>
334                                         </goals>
335                                         <configuration>
336                                              <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
337                                              <!-- <append>true</append> -->
338                                         </configuration>
339                                   </execution>
340                                   <execution>
341                                         <id>pre-integration-test</id>
342                                         <phase>pre-integration-test</phase>
343                                         <goals>
344                                              <goal>prepare-agent</goal>
345                                         </goals>
346                                         <configuration>
347                                              <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>
348                                              <!-- <append>true</append> -->
349                                         </configuration>
350                                   </execution>
351                                   <execution>
352                                         <goals>
353                                              <goal>merge</goal>
354                                         </goals>
355                                         <phase>post-integration-test</phase>
356                                         <configuration>
357                                              <fileSets>
358                                                    <fileSet implementation="org.apache.maven.shared.model.fileset.FileSet">
359                                                        <directory>${project.build.directory}/coverage-reports</directory>
360                                                        <includes>
361                                                              <include>*.exec</include>
362                                                        </includes>
363                                                   </fileSet>
364                                              </fileSets>
365                                              <destFile>${project.build.directory}/jacoco-dev.exec</destFile>
366                                         </configuration>
367                                    </execution>
368                              </executions>
369                         </plugin>
370                         <plugin>
371                                 <artifactId>maven-source-plugin</artifactId>
372                                 <executions>
373                                         <execution>
374                                                 <id>attach-sources</id>
375                                                 <phase>deploy</phase>
376                                                 <goals>
377                                                         <goal>jar-no-fork</goal>
378                                                 </goals>
379                                         </execution>
380                                 </executions>
381                         </plugin>
382                 </plugins>
383         </build>
384
385
386
387         <profiles>
388                 <profile>
389                         <id>docker</id>
390                         <build>
391                                 <plugins>
392                                         <plugin>
393                                                 <groupId>io.fabric8</groupId>
394                                                 <artifactId>docker-maven-plugin</artifactId>
395                                                 <version>0.25.0</version>
396                                                 <configuration>
397                                                         <verbose>true</verbose>
398                                                         <apiVersion>1.23</apiVersion>
399                                                         <pullRegistry>${docker.pull.registry}</pullRegistry>
400                                                         <pushRegistry>${docker.push.registry}</pushRegistry>
401                                                         <images>
402                                                                 <image>
403                                                                         <name>onap/externalapi/nbi</name>
404                                                                         <alias>onap/externalapi/nbi</alias>
405                                                                         <build>
406                                                                                 <cleanup>true</cleanup>
407                                                                                 <tags>
408                                                                                         <tag>${docker.tag}</tag>
409                                                                                         <tag>${docker.latest.tag}</tag>
410                                                                                 </tags>
411                                                                                 <dockerFileDir>${project.basedir}</dockerFileDir>
412                                                                                 <args>
413                                                                                         <PKG_FILENAME>${project.build.finalName}.${project.packaging}</PKG_FILENAME>
414                                                                                 </args>
415                                                                         </build>
416                                                                 </image>
417                                                         </images>
418                                                 </configuration>
419                                                 <executions>
420                                                         <execution>
421                                                                 <id>clean-images</id>
422                                                                 <phase>pre-clean</phase>
423                                                                 <goals>
424                                                                         <goal>remove</goal>
425                                                                 </goals>
426                                                                 <configuration>
427                                                                         <removeMode>all</removeMode>
428                                                                 </configuration>
429                                                         </execution>
430                                                         <execution>
431                                                                 <id>generate-images</id>
432                                                                 <phase>package</phase>
433                                                                 <goals>
434                                                                         <goal>build</goal>
435                                                                 </goals>
436                                                         </execution>
437                                                         <execution>
438                                                                 <id>push-images</id>
439                                                                 <phase>deploy</phase>
440                                                                 <goals>
441                                                                         <goal>push</goal>
442                                                                 </goals>
443                                                         </execution>
444                                                 </executions>
445                                         </plugin>
446                                 </plugins>
447                         </build>
448                 </profile>
449         </profiles>
450
451 </project>