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