727307a3ce2e5cc125126d715c3151318db092c4
[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>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.9.4</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>2.1.4.RELEASE</version>
150     </dependency>
151
152     <dependency>
153       <groupId>org.springframework.boot</groupId>
154       <artifactId>spring-boot-starter-tomcat</artifactId>
155       <scope>provided</scope>
156     </dependency>
157
158     <dependency>
159       <groupId>org.springframework.boot</groupId>
160       <artifactId>spring-boot-starter-aop</artifactId>
161     </dependency>
162
163     <dependency>
164       <groupId>org.apache.commons</groupId>
165       <artifactId>commons-io</artifactId>
166       <version>1.3.2</version>
167     </dependency>
168
169     <dependency>
170       <groupId>commons-beanutils</groupId>
171       <artifactId>commons-beanutils</artifactId>
172       <version>1.9.3</version>
173     </dependency>
174
175     <dependency>
176       <groupId>javax.validation</groupId>
177       <artifactId>validation-api</artifactId>
178       <version>2.0.1.Final</version>
179     </dependency>
180
181     <dependency>
182       <groupId>org.apache.commons</groupId>
183       <artifactId>commons-lang3</artifactId>
184       <version>3.4</version>
185     </dependency>
186
187     <!-- mongo -->
188
189     <dependency>
190       <groupId>org.springframework.boot</groupId>
191       <artifactId>spring-boot-starter-data-mongodb</artifactId>
192     </dependency>
193
194     <!-- mysql -->
195
196     <dependency>
197       <groupId>org.mariadb.jdbc</groupId>
198       <artifactId>mariadb-java-client</artifactId>
199       <version>1.1.7</version>
200     </dependency>
201
202     <!-- swagger -->
203
204     <dependency>
205       <groupId>io.swagger</groupId>
206       <artifactId>swagger-annotations</artifactId>
207       <version>1.5.18</version>
208     </dependency>
209
210     <!-- jackson -->
211
212     <dependency>
213       <groupId>com.fasterxml.jackson.dataformat</groupId>
214       <artifactId>jackson-dataformat-yaml</artifactId>
215       <version>2.9.6</version>
216     </dependency>
217
218     <!-- sdc tosca parser -->
219
220     <dependency>
221       <groupId>org.onap.sdc.sdc-tosca</groupId>
222       <artifactId>sdc-tosca</artifactId>
223       <version>1.4.6</version>
224     </dependency>
225
226     <!-- jolt -->
227
228     <dependency>
229       <groupId>com.bazaarvoice.jolt</groupId>
230       <artifactId>jolt-core</artifactId>
231       <version>0.1.0</version>
232       <exclusions>
233         <exclusion>
234           <groupId>com.fasterxml.jackson.core</groupId>
235           <artifactId>jackson-databind</artifactId>
236         </exclusion>
237       </exclusions>
238     </dependency>
239
240     <dependency>
241       <groupId>com.bazaarvoice.jolt</groupId>
242       <artifactId>json-utils</artifactId>
243       <version>0.1.0</version>
244       <exclusions>
245         <exclusion>
246           <groupId>com.fasterxml.jackson.core</groupId>
247           <artifactId>jackson-databind</artifactId>
248         </exclusion>
249       </exclusions>
250     </dependency>
251
252     <!-- test -->
253
254     <dependency>
255       <groupId>org.springframework.boot</groupId>
256       <artifactId>spring-boot-starter-test</artifactId>
257       <scope>test</scope>     
258     </dependency>
259
260     <!-- test h2 -->
261
262     <dependency>
263       <groupId>com.h2database</groupId>
264       <artifactId>h2</artifactId>
265       <scope>test</scope>
266     </dependency>
267
268     <dependency>
269       <groupId>de.flapdoodle.embed</groupId>
270       <artifactId>de.flapdoodle.embed.mongo</artifactId>
271       <version>${embedded-mongo.version}</version>
272       <scope>test</scope>
273     </dependency>
274
275     <!-- test wiremock -->
276
277     <dependency>
278       <groupId>org.springframework.cloud</groupId>
279       <artifactId>spring-cloud-contract-wiremock</artifactId>
280       <version>1.2.6.RELEASE</version>
281       <scope>test</scope>
282       <exclusions>
283         <exclusion>
284           <groupId>com.fasterxml.jackson.core</groupId>
285           <artifactId>jackson-databind</artifactId>
286         </exclusion>
287       </exclusions>
288     </dependency>
289
290     <dependency>
291       <groupId>org.eclipse.jetty</groupId>
292       <artifactId>jetty-servlet</artifactId>
293       <scope>test</scope>
294     </dependency>
295
296     <dependency>
297       <groupId>org.eclipse.jetty</groupId>
298       <artifactId>jetty-servlets</artifactId>
299       <scope>test</scope>
300     </dependency>
301
302     <!-- runtime dev -->
303
304     <dependency>
305       <groupId>org.springframework.boot</groupId>
306       <artifactId>spring-boot-devtools</artifactId>
307       <scope>runtime</scope>
308     </dependency>
309
310     <!-- MSB SDK -->
311     <dependency>
312       <groupId>org.onap.msb.java-sdk</groupId>
313       <artifactId>msb-java-sdk</artifactId>
314       <version>1.1.1</version>
315       <exclusions>
316         <exclusion>
317           <groupId>com.fasterxml.jackson.core</groupId>
318           <artifactId>jackson-databind</artifactId>
319         </exclusion>
320       </exclusions>
321     </dependency>
322
323     <!-- karate -->
324
325     <dependency>
326       <groupId>com.intuit.karate</groupId>
327       <artifactId>karate-junit4</artifactId>
328       <version>0.9.0</version>
329       <scope>test</scope>
330     </dependency>
331     <dependency>
332       <groupId>com.intuit.karate</groupId>
333       <artifactId>karate-apache</artifactId>
334       <version>0.9.0</version>
335       <scope>test</scope>
336     </dependency>
337
338
339   </dependencies>
340
341   <build>
342     <testResources>
343       <testResource>
344         <directory>src/test/java</directory>
345         <excludes>
346           <exclude>**/*.java</exclude>
347         </excludes>
348       </testResource>
349       <testResource>
350         <directory>src/test/resources</directory>
351       </testResource>
352     </testResources>
353     <plugins>
354       <plugin>
355         <groupId>org.springframework.boot</groupId>
356         <artifactId>spring-boot-maven-plugin</artifactId>
357       </plugin>
358       <plugin>
359         <groupId>org.apache.maven.plugins</groupId>
360         <artifactId>maven-surefire-plugin</artifactId>
361         <configuration>
362           <includes>
363             <include>org/onap/nbi/test/KarateApiTest.java</include>
364              <include>org/onap/nbi/test/ExecutionTaskTest.java</include>
365             <include>org/onap/nbi/test/ServiceOrderRepositoryTest.java</include>
366             <include>org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java</include>
367           </includes>
368         </configuration>
369       </plugin>
370       <plugin>
371         <groupId>org.sonatype.plugins</groupId>
372         <artifactId>nexus-staging-maven-plugin</artifactId>
373         <version>1.6.7</version>
374         <extensions>true</extensions>
375         <configuration>
376           <nexusUrl>${nexusproxy}</nexusUrl>
377           <stagingProfileId>176c31dfe190a</stagingProfileId>
378           <serverId>ecomp-staging</serverId>
379         </configuration>
380       </plugin>
381       <plugin>
382         <groupId>org.apache.maven.plugins</groupId>
383         <artifactId>maven-site-plugin</artifactId>
384         <version>3.6</version>
385         <dependencies>
386           <dependency>
387             <groupId>org.apache.maven.wagon</groupId>
388             <artifactId>wagon-webdav-jackrabbit</artifactId>
389             <version>2.10</version>
390           </dependency>
391         </dependencies>
392       </plugin>
393       <plugin>
394         <groupId>com.mycila</groupId>
395         <artifactId>license-maven-plugin</artifactId>
396         <version>3.0</version>
397         <configuration>
398           <header>LICENSE.TXT</header>
399           <includes>
400             <include>restclient/**</include>
401             <include>src/**</include>
402             <include>./**/*.xml</include>
403             <include>./**/*.xml</include>
404             <include>./**/*.yml</include>
405             <include>./**/*.yaml</include>
406           </includes>
407           <excludes>
408             <!-- karate-config.js doesn't support comment, and is mandatory by
409               karate -->
410             <exclude>src/test/java/karate-config.js</exclude>
411           </excludes>
412           <skipExistingHeaders>true</skipExistingHeaders>
413           <skip>false</skip>
414           <mapping>
415             <http>SCRIPT_STYLE</http>
416           </mapping>
417         </configuration>
418         <executions>
419           <execution>
420             <goals>
421               <!-- Set goal to "format" to auto update license headers -->
422               <goal>check</goal>
423             </goals>
424             <phase>process-sources</phase>
425           </execution>
426         </executions>
427       </plugin>
428       <plugin>
429         <groupId>org.codehaus.mojo</groupId>
430         <artifactId>sonar-maven-plugin</artifactId>
431         <version>3.2</version>
432       </plugin>
433 <!--       <plugin> -->
434 <!--         <groupId>org.jacoco</groupId> -->
435 <!--         <artifactId>jacoco-maven-plugin</artifactId> -->
436 <!--         <version>0.8.1</version> -->
437 <!--         <configuration> -->
438 <!--           <dumpOnExit>true</dumpOnExit> -->
439 <!--           <includes> -->
440 <!--             <include>org.onap.nbi.*</include> -->
441 <!--           </includes> -->
442 <!--           <excludes> -->
443 <!--             <exclude>**/model/**/*</exclude> -->
444 <!--           </excludes> -->
445 <!--         </configuration> -->
446 <!--         <executions> -->
447 <!--           <execution> -->
448 <!--             <id>pre-unit-test</id> -->
449 <!--             <goals> -->
450 <!--               <goal>prepare-agent</goal> -->
451 <!--             </goals> -->
452 <!--             <configuration> -->
453 <!--               <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile> -->
454 <!--               <append>true</append> -->
455 <!--             </configuration> -->
456 <!--           </execution> -->
457 <!--           <execution> -->
458 <!--             <id>pre-integration-test</id> -->
459 <!--             <phase>pre-integration-test</phase> -->
460 <!--             <goals> -->
461 <!--               <goal>prepare-agent</goal> -->
462 <!--             </goals> -->
463 <!--             <configuration> -->
464 <!--               <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile> -->
465 <!--               <append>true</append> -->
466 <!--             </configuration> -->
467 <!--           </execution> -->
468 <!--           <execution> -->
469 <!--             <goals> -->
470 <!--               <goal>merge</goal> -->
471 <!--             </goals> -->
472 <!--             <phase>post-integration-test</phase> -->
473 <!--             <configuration> -->
474 <!--               <fileSets> -->
475 <!--                 <fileSet -->
476 <!--                   implementation="org.apache.maven.shared.model.fileset.FileSet"> -->
477 <!--                   <directory>${project.build.directory}/coverage-reports</directory> -->
478 <!--                   <includes> -->
479 <!--                     <include>*.exec</include> -->
480 <!--                   </includes> -->
481 <!--                 </fileSet> -->
482 <!--               </fileSets> -->
483 <!--               <destFile>${project.build.directory}/jacoco-dev.exec</destFile> -->
484 <!--             </configuration> -->
485 <!--           </execution> -->
486 <!--         </executions> -->
487 <!--       </plugin> -->
488       <plugin>
489         <artifactId>maven-source-plugin</artifactId>
490         <executions>
491           <execution>
492             <id>attach-sources</id>
493             <phase>deploy</phase>
494             <goals>
495               <goal>jar-no-fork</goal>
496             </goals>
497           </execution>
498         </executions>
499       </plugin>
500     </plugins>
501   </build>
502
503
504   <profiles>
505     <profile>
506       <id>docker</id>
507       <build>
508         <plugins>
509           <plugin>
510             <groupId>io.fabric8</groupId>
511             <artifactId>docker-maven-plugin</artifactId>
512             <version>0.26.1</version>
513             <configuration>
514               <verbose>true</verbose>
515               <apiVersion>1.23</apiVersion>
516               <pullRegistry>${docker.pull.registry}</pullRegistry>
517               <pushRegistry>${docker.push.registry}</pushRegistry>
518               <images>
519                 <image>
520                   <name>onap/externalapi/nbi:${docker.tag}</name>
521                   <build>
522                     <cleanup>true</cleanup>
523                     <tags>
524                       <tag>latest</tag>
525                       <tag>${docker.latest.tag}</tag>
526                     </tags>
527                     <dockerFileDir>${project.basedir}</dockerFileDir>
528                     <args>
529                       <PKG_FILENAME>${project.build.finalName}.${project.packaging}</PKG_FILENAME>
530                     </args>
531                   </build>
532                 </image>
533               </images>
534             </configuration>
535             <executions>
536               <execution>
537                 <id>clean-images</id>
538                 <phase>pre-clean</phase>
539                 <goals>
540                   <goal>remove</goal>
541                 </goals>
542                 <configuration>
543                   <removeMode>all</removeMode>
544                 </configuration>
545               </execution>
546               <execution>
547                 <id>generate-images</id>
548                 <phase>package</phase>
549                 <goals>
550                   <goal>build</goal>
551                 </goals>
552               </execution>
553               <execution>
554                 <id>push-images</id>
555                 <phase>deploy</phase>
556                 <goals>
557                   <goal>push</goal>
558                 </goals>
559               </execution>
560             </executions>
561           </plugin>
562         </plugins>
563       </build>
564     </profile>
565   </profiles>
566
567 </project>