505777a2101bb50c1f817736b1285f238705ea1d
[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>externalapi-nbi</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>org.mariadb.jdbc</groupId>
150                         <artifactId>mariadb-java-client</artifactId>
151                         <version>1.1.7</version>
152                 </dependency>
153
154                 <!-- swagger -->
155
156                 <dependency>
157                         <groupId>io.swagger</groupId>
158                         <artifactId>swagger-annotations</artifactId>
159                         <version>1.5.18</version>
160                 </dependency>
161
162                 <!-- jackson -->
163
164                 <dependency>
165                         <groupId>com.fasterxml.jackson.dataformat</groupId>
166                         <artifactId>jackson-dataformat-yaml</artifactId>
167                         <version>2.8.0</version>
168                 </dependency>
169
170                 <!-- jolt -->
171
172                 <dependency>
173                         <groupId>com.bazaarvoice.jolt</groupId>
174                         <artifactId>jolt-core</artifactId>
175                         <version>0.1.0</version>
176                         <exclusions>
177                                 <exclusion>
178                                         <groupId>com.fasterxml.jackson.core</groupId>
179                                         <artifactId>jackson-databind</artifactId>
180                                 </exclusion>
181                         </exclusions>
182                 </dependency>
183
184                 <dependency>
185                         <groupId>com.bazaarvoice.jolt</groupId>
186                         <artifactId>json-utils</artifactId>
187                         <version>0.1.0</version>
188                 </dependency>
189
190                 <!-- test -->
191
192                 <dependency>
193                         <groupId>org.springframework.boot</groupId>
194                         <artifactId>spring-boot-starter-test</artifactId>
195                         <scope>test</scope>
196                 </dependency>
197
198                 <!-- test h2 -->
199
200                 <dependency>
201                         <groupId>com.h2database</groupId>
202                         <artifactId>h2</artifactId>
203                         <scope>test</scope>
204                 </dependency>
205
206                 <dependency>
207                         <groupId>de.flapdoodle.embed</groupId>
208                         <artifactId>de.flapdoodle.embed.mongo</artifactId>
209                         <version>${embedded-mongo.version}</version>
210                         <scope>test</scope>
211                 </dependency>
212
213                 <!-- test wiremock -->
214
215                 <dependency>
216                         <groupId>org.springframework.cloud</groupId>
217                         <artifactId>spring-cloud-contract-wiremock</artifactId>
218                         <version>1.0.0.RELEASE</version>
219                         <scope>test</scope>
220                 </dependency>
221
222                 <dependency>
223                         <groupId>org.eclipse.jetty</groupId>
224                         <artifactId>jetty-server</artifactId>
225                         <version>9.4.7.RC0</version>
226                         <scope>test</scope>
227                 </dependency>
228
229                 <dependency>
230                         <groupId>org.eclipse.jetty</groupId>
231                         <artifactId>jetty-servlet</artifactId>
232                         <scope>test</scope>
233                 </dependency>
234
235                 <dependency>
236                         <groupId>org.eclipse.jetty</groupId>
237                         <artifactId>jetty-servlets</artifactId>
238                         <scope>test</scope>
239                 </dependency>
240
241                 <!-- runtime dev -->
242
243                 <dependency>
244                         <groupId>org.springframework.boot</groupId>
245                         <artifactId>spring-boot-devtools</artifactId>
246                         <scope>runtime</scope>
247                 </dependency>
248
249         </dependencies>
250
251         <build>
252                 <plugins>
253                         <plugin>
254                                 <groupId>org.springframework.boot</groupId>
255                                 <artifactId>spring-boot-maven-plugin</artifactId>
256                         </plugin>
257                         <plugin>
258                                 <groupId>org.sonatype.plugins</groupId>
259                                 <artifactId>nexus-staging-maven-plugin</artifactId>
260                                 <version>1.6.7</version>
261                                 <extensions>true</extensions>
262                                 <configuration>
263                                         <nexusUrl>${nexusproxy}</nexusUrl>
264                                         <stagingProfileId>176c31dfe190a</stagingProfileId>
265                                         <serverId>ecomp-staging</serverId>
266                                 </configuration>
267                         </plugin>
268                         <plugin>
269                                 <groupId>org.apache.maven.plugins</groupId>
270                                 <artifactId>maven-site-plugin</artifactId>
271                                 <version>3.6</version>
272                                 <dependencies>
273                                         <dependency>
274                                                 <groupId>org.apache.maven.wagon</groupId>
275                                                 <artifactId>wagon-webdav-jackrabbit</artifactId>
276                                                 <version>2.10</version>
277                                         </dependency>
278                                 </dependencies>
279                         </plugin>
280                         <plugin>
281                                 <groupId>com.mycila</groupId>
282                                 <artifactId>license-maven-plugin</artifactId>
283                                 <version>3.0</version>
284                                 <configuration>
285                                         <header>LICENSE.TXT</header>
286                                         <includes>
287                                                 <include>restclient/**</include>
288                                                 <include>src/**</include>
289                                                 <include>pom.xml</include>
290                                         </includes>
291                                         <skipExistingHeaders>true</skipExistingHeaders>
292                                         <skip>false</skip>
293                                         <mapping>
294                                                 <http>SCRIPT_STYLE</http>
295                                         </mapping>
296                                 </configuration>
297                                 <executions>
298                                         <execution>
299                                                 <goals>
300                                                         <!-- Set goal to "format" to auto update license headers -->
301                                                         <goal>check</goal>
302                                                 </goals>
303                                                 <phase>process-sources</phase>
304                                         </execution>
305                                 </executions>
306                         </plugin>
307                         <plugin>
308                                 <groupId>org.codehaus.mojo</groupId>
309                                 <artifactId>sonar-maven-plugin</artifactId>
310                                 <version>3.2</version>
311                         </plugin>
312                         <plugin>
313                              <groupId>org.jacoco</groupId>
314                              <artifactId>jacoco-maven-plugin</artifactId>
315                              <version>0.7.7.201606060606</version>
316                              <configuration>
317                                   <dumpOnExit>true</dumpOnExit>
318                                   <includes>
319                                         <include>org.onap.nbi.*</include>
320                                   </includes>
321                                   <excludes>
322                                         <exclude>**/model/**/*</exclude>
323                                   </excludes>        
324                              </configuration>
325                              <executions>
326                                   <execution>
327                                         <id>pre-unit-test</id>
328                                         <goals>
329                                              <goal>prepare-agent</goal>
330                                         </goals>
331                                         <configuration>
332                                              <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
333                                              <!-- <append>true</append> -->
334                                         </configuration>
335                                   </execution>
336                                   <execution>
337                                         <id>pre-integration-test</id>
338                                         <phase>pre-integration-test</phase>
339                                         <goals>
340                                              <goal>prepare-agent</goal>
341                                         </goals>
342                                         <configuration>
343                                              <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>
344                                              <!-- <append>true</append> -->
345                                         </configuration>
346                                   </execution>
347                                   <execution>
348                                         <goals>
349                                              <goal>merge</goal>
350                                         </goals>
351                                         <phase>post-integration-test</phase>
352                                         <configuration>
353                                              <fileSets>
354                                                    <fileSet implementation="org.apache.maven.shared.model.fileset.FileSet">
355                                                        <directory>${project.build.directory}/coverage-reports</directory>
356                                                        <includes>
357                                                              <include>*.exec</include>
358                                                        </includes>
359                                                   </fileSet>
360                                              </fileSets>
361                                              <destFile>${project.build.directory}/jacoco-dev.exec</destFile>
362                                         </configuration>
363                                    </execution>
364                              </executions>
365                         </plugin>
366                         <plugin>
367                                 <artifactId>maven-source-plugin</artifactId>
368                                 <executions>
369                                         <execution>
370                                                 <id>attach-sources</id>
371                                                 <phase>deploy</phase>
372                                                 <goals>
373                                                         <goal>jar-no-fork</goal>
374                                                 </goals>
375                                         </execution>
376                                 </executions>
377                         </plugin>
378                 </plugins>
379         </build>
380
381
382
383         <profiles>
384                 <profile>
385                         <id>docker</id>
386                         <build>
387                                 <plugins>
388                                         <plugin>
389                                                 <groupId>io.fabric8</groupId>
390                                                 <artifactId>docker-maven-plugin</artifactId>
391                                                 <version>0.25.0</version>
392                                                 <configuration>
393                                                         <verbose>true</verbose>
394                                                         <apiVersion>1.23</apiVersion>
395                                                         <pullRegistry>${docker.pull.registry}</pullRegistry>
396                                                         <pushRegistry>${docker.push.registry}</pushRegistry>
397                                                         <images>
398                                                                 <image>
399                                                                         <name>onap/externalapi/nbi</name>
400                                                                         <alias>onap/externalapi/nbi</alias>
401                                                                         <build>
402                                                                                 <cleanup>true</cleanup>
403                                                                                 <tags>
404                                                                                         <tag>${docker.tag}</tag>
405                                                                                         <tag>${docker.latest.tag}</tag>
406                                                                                 </tags>
407                                                                                 <dockerFileDir>${project.basedir}</dockerFileDir>
408                                                                                 <args>
409                                                                                         <PKG_FILENAME>${project.build.finalName}.${project.packaging}</PKG_FILENAME>
410                                                                                 </args>
411                                                                         </build>
412                                                                 </image>
413                                                         </images>
414                                                 </configuration>
415                                                 <executions>
416                                                         <execution>
417                                                                 <id>clean-images</id>
418                                                                 <phase>pre-clean</phase>
419                                                                 <goals>
420                                                                         <goal>remove</goal>
421                                                                 </goals>
422                                                                 <configuration>
423                                                                         <removeMode>all</removeMode>
424                                                                 </configuration>
425                                                         </execution>
426                                                         <execution>
427                                                                 <id>generate-images</id>
428                                                                 <phase>package</phase>
429                                                                 <goals>
430                                                                         <goal>build</goal>
431                                                                 </goals>
432                                                         </execution>
433                                                         <execution>
434                                                                 <id>push-images</id>
435                                                                 <phase>deploy</phase>
436                                                                 <goals>
437                                                                         <goal>push</goal>
438                                                                 </goals>
439                                                         </execution>
440                                                 </executions>
441                                         </plugin>
442                                 </plugins>
443                         </build>
444                 </profile>
445         </profiles>
446
447 </project>