Fix unit testing instability
[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>1.5.12.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>org.apache.tomcat.embed</groupId>
108           <artifactId>tomcat-embed-core</artifactId>
109         </exclusion>
110         <exclusion>
111           <groupId>com.fasterxml.jackson.core</groupId>
112           <artifactId>jackson-databind</artifactId>
113         </exclusion>
114       </exclusions>
115     </dependency>
116
117     <dependency>
118       <groupId>com.fasterxml.jackson.core</groupId>
119       <artifactId>jackson-databind</artifactId>
120       <version>2.8.11.2</version>
121     </dependency>
122
123     <dependency>
124       <groupId>org.apache.tomcat.embed</groupId>
125       <artifactId>tomcat-embed-core</artifactId>
126       <version>8.5.32</version>
127     </dependency>
128
129     <dependency>
130       <groupId>ch.qos.logback</groupId>
131       <artifactId>logback-classic</artifactId>
132       <version>1.2.3</version>
133     </dependency>
134
135     <dependency>
136       <groupId>org.springframework.boot</groupId>
137       <artifactId>spring-boot-starter-data-jpa</artifactId>
138       <exclusions>
139         <exclusion>
140           <groupId>org.springframework.data</groupId>
141           <artifactId>spring-data-commons</artifactId>
142         </exclusion>
143       </exclusions>
144     </dependency>
145
146     <dependency>
147       <groupId>org.springframework.data</groupId>
148       <artifactId>spring-data-commons</artifactId>
149       <version>1.13.14.RELEASE</version>
150     </dependency>
151
152     <dependency>
153       <groupId>org.springframework.boot</groupId>
154       <artifactId>spring-boot-starter-aop</artifactId>
155     </dependency>
156
157     <dependency>
158       <groupId>org.apache.commons</groupId>
159       <artifactId>commons-io</artifactId>
160       <version>1.3.2</version>
161     </dependency>
162
163     <dependency>
164       <groupId>commons-beanutils</groupId>
165       <artifactId>commons-beanutils</artifactId>
166       <version>1.9.3</version>
167     </dependency>
168
169     <dependency>
170       <groupId>javax.validation</groupId>
171       <artifactId>validation-api</artifactId>
172       <version>2.0.1.Final</version>
173     </dependency>
174
175     <dependency>
176       <groupId>org.apache.commons</groupId>
177       <artifactId>commons-lang3</artifactId>
178       <version>3.4</version>
179     </dependency>
180
181     <!-- mongo -->
182
183     <dependency>
184       <groupId>org.springframework.boot</groupId>
185       <artifactId>spring-boot-starter-data-mongodb</artifactId>
186     </dependency>
187
188     <!-- mysql -->
189
190     <dependency>
191       <groupId>org.mariadb.jdbc</groupId>
192       <artifactId>mariadb-java-client</artifactId>
193       <version>1.1.7</version>
194     </dependency>
195
196     <!-- swagger -->
197
198     <dependency>
199       <groupId>io.swagger</groupId>
200       <artifactId>swagger-annotations</artifactId>
201       <version>1.5.18</version>
202     </dependency>
203
204     <!-- jackson -->
205
206     <dependency>
207       <groupId>com.fasterxml.jackson.dataformat</groupId>
208       <artifactId>jackson-dataformat-yaml</artifactId>
209       <version>2.9.6</version>
210     </dependency>
211
212     <!-- sdc tosca parser -->
213
214     <dependency>
215       <groupId>org.onap.sdc.sdc-tosca</groupId>
216       <artifactId>sdc-tosca</artifactId>
217       <version>1.4.6</version>
218     </dependency>
219
220     <!-- jolt -->
221
222     <dependency>
223       <groupId>com.bazaarvoice.jolt</groupId>
224       <artifactId>jolt-core</artifactId>
225       <version>0.1.0</version>
226       <exclusions>
227         <exclusion>
228           <groupId>com.fasterxml.jackson.core</groupId>
229           <artifactId>jackson-databind</artifactId>
230         </exclusion>
231       </exclusions>
232     </dependency>
233
234     <dependency>
235       <groupId>com.bazaarvoice.jolt</groupId>
236       <artifactId>json-utils</artifactId>
237       <version>0.1.0</version>
238       <exclusions>
239         <exclusion>
240           <groupId>com.fasterxml.jackson.core</groupId>
241           <artifactId>jackson-databind</artifactId>
242         </exclusion>
243       </exclusions>
244     </dependency>
245
246     <!-- test -->
247
248     <dependency>
249       <groupId>org.springframework.boot</groupId>
250       <artifactId>spring-boot-starter-test</artifactId>
251       <scope>test</scope>     
252     </dependency>
253
254     <!-- test h2 -->
255
256     <dependency>
257       <groupId>com.h2database</groupId>
258       <artifactId>h2</artifactId>
259       <scope>test</scope>
260     </dependency>
261
262     <dependency>
263       <groupId>de.flapdoodle.embed</groupId>
264       <artifactId>de.flapdoodle.embed.mongo</artifactId>
265       <version>${embedded-mongo.version}</version>
266       <scope>test</scope>
267     </dependency>
268
269     <!-- test wiremock -->
270
271     <dependency>
272       <groupId>org.springframework.cloud</groupId>
273       <artifactId>spring-cloud-contract-wiremock</artifactId>
274       <version>1.2.6.RELEASE</version>
275       <scope>test</scope>
276       <exclusions>
277         <exclusion>
278           <groupId>com.fasterxml.jackson.core</groupId>
279           <artifactId>jackson-databind</artifactId>
280         </exclusion>
281       </exclusions>
282     </dependency>
283
284     <dependency>
285       <groupId>org.eclipse.jetty</groupId>
286       <artifactId>jetty-servlet</artifactId>
287       <scope>test</scope>
288     </dependency>
289
290     <dependency>
291       <groupId>org.eclipse.jetty</groupId>
292       <artifactId>jetty-servlets</artifactId>
293       <scope>test</scope>
294     </dependency>
295
296     <!-- runtime dev -->
297
298     <dependency>
299       <groupId>org.springframework.boot</groupId>
300       <artifactId>spring-boot-devtools</artifactId>
301       <scope>runtime</scope>
302     </dependency>
303
304     <!-- MSB SDK -->
305     <dependency>
306       <groupId>org.onap.msb.java-sdk</groupId>
307       <artifactId>msb-java-sdk</artifactId>
308       <version>1.1.1</version>
309       <exclusions>
310         <exclusion>
311           <groupId>com.fasterxml.jackson.core</groupId>
312           <artifactId>jackson-databind</artifactId>
313         </exclusion>
314       </exclusions>
315     </dependency>
316
317     <!-- karate -->
318
319     <dependency>
320       <groupId>com.intuit.karate</groupId>
321       <artifactId>karate-junit4</artifactId>
322       <version>0.9.0</version>
323       <scope>test</scope>
324     </dependency>
325     <dependency>
326       <groupId>com.intuit.karate</groupId>
327       <artifactId>karate-apache</artifactId>
328       <version>0.9.0</version>
329       <scope>test</scope>
330     </dependency>
331
332
333   </dependencies>
334
335   <build>
336     <testResources>
337       <testResource>
338         <directory>src/test/java</directory>
339         <excludes>
340           <exclude>**/*.java</exclude>
341         </excludes>
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/test/ApiTestWithoutOnap.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>