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