888cca5559dd864c14fd14ecdfcb7f445f0510b5
[demos/example-siren] / provider / build.gradle
1 plugins {
2         id 'org.springframework.boot' version '2.3.4.RELEASE'
3         id 'io.spring.dependency-management' version '1.0.10.RELEASE'
4         id 'java'
5         id "io.freefair.lombok" version "5.2.1"
6         id "au.com.dius.pact" version "4.1.7"
7         id "com.wiredforcode.spawn" version "0.8.2"
8 }
9
10 group = 'io.pactflow.example'
11 version = '0.0.1'
12 sourceCompatibility = '11'
13
14 repositories {
15         mavenCentral()
16 }
17
18 dependencies {
19         implementation 'org.springframework.boot:spring-boot-starter-hateoas'
20         implementation 'com.jayway.jsonpath:json-path'
21         implementation 'de.ingogriebsch.hateoas:spring-hateoas-siren:1.0.0-M2'
22
23         testImplementation('org.springframework.boot:spring-boot-starter-test') {
24                 exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
25         }
26 }
27
28 test {
29         useJUnitPlatform()
30 }
31
32 task startServer(type: SpawnProcessTask, dependsOn: 'assemble') {
33         command "java -jar ${projectDir}/build/libs/siren-provider-0.0.1.jar"
34         ready 'Started SirenProviderApplication'
35 }
36
37 task stopServer(type: KillProcessTask)
38
39 pact {
40         serviceProviders {
41                 "Siren Order Provider" {
42
43                         startProviderTask = startServer
44                         terminateProviderTask = stopServer
45
46                         hasPactWith("Siren Consumer") {
47                                 pactSource = file("${projectDir}/../consumer/pacts/Siren Order Provider-Siren Order Service.json")
48                         }
49                 }
50         }
51 }