generated from cloud-native-toolkit/inventory-management-svc-solution
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
124 lines (105 loc) · 4.52 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
buildscript {
ext {
springBootVersion = '2.2.5.RELEASE'
springStarterSleuth = '2.1.1.RELEASE'
pactVersion = '4.0.7'
checkstyleVersion = '7.6.1'
junitVersion = '5.4.2'
mockitoVersion = '2.27.0'
powermockMockitoVersion = '2.0.2'
jacocoVersion = '0.8.4'
libertyVersion = '18.0.0.1'
swaggerVersion = '2.9.2'
jaxbVersion = '2.2.11'
wsdlVersion = '1.6.1'
}
}
plugins {
id 'org.springframework.boot' version '2.2.5.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
id 'jacoco'
id 'au.com.dius.pact' version '4.0.7'
id 'com.adarshr.test-logger' version '2.0.0'
id 'org.sonarqube' version '2.8'
}
group = 'application'
version = '0.0.1'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencyManagement {
dependencies {
dependency group: 'org.springframework.cloud', name: 'spring-cloud-starter-sleuth', version: '2.2.5.RELEASE'
dependency group: 'org.springframework.cloud', name: 'spring-cloud-sleuth-zipkin', version: '2.2.5.RELEASE'
dependency group: 'io.opentracing.brave', name: 'brave-opentracing', version: '0.31.3'
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
implementation("org.apache.httpcomponents:httpclient")
compileOnly("org.springframework.boot:spring-boot-devtools")
// needed for IntelliJ
compileOnly("org.springframework.boot:spring-boot-configuration-processor")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
// spring actuator
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
implementation group: 'io.opentracing', name: 'opentracing-api', version: '0.33.0'
implementation group: 'io.opentracing.contrib', name: 'opentracing-spring-cloud-starter', version: '0.5.4'
implementation group: 'io.jaegertracing', name: 'jaeger-client', version: '1.2.0'
// cloudant
implementation group: 'com.cloudant', name: 'cloudant-client', version: '2.17.0'
implementation group: 'com.jayway.jsonpath', name: 'json-path', version: '2.4.0'
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.1'
implementation group: 'joda-time', name: 'joda-time', version: '2.10.3'
// pact
testImplementation group: 'au.com.dius', name: 'pact-jvm-provider-junit5', version: project.pactVersion
testImplementation group: 'au.com.dius', name: 'pact-jvm-provider', version: project.pactVersion
testImplementation group: 'au.com.dius', name: 'pact-jvm-consumer-junit5', version: project.pactVersion
testImplementation group: 'au.com.dius', name: 'pact-jvm-consumer', version: project.pactVersion
// swagger
implementation group: 'io.springfox', name: 'springfox-swagger2', version: "${swaggerVersion}"
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: "${swaggerVersion}"
testImplementation("org.powermock:powermock-api-mockito2:${powermockMockitoVersion}")
// https://mvnrepository.com/artifact/io.opentracing.contrib/opentracing-spring-jaeger-cloud-starter
compile group: 'io.opentracing.contrib', name: 'opentracing-spring-jaeger-cloud-starter', version: '3.1.1'
}
test {
useJUnitPlatform()
}
testlogger {
theme 'mocha'
}
task copyJarToServerJar(type: Copy) {
from ('build/libs') {
rename "${project.name}-${project.version}.jar", 'server.jar'
}
into 'build/libs'
}
task run {
dependsOn 'bootRun'
}
def pactBrokerUrl = project.hasProperty('pactBrokerUrl') ? pactBrokerUrl : 'http://localhost'
def providerName = project.hasProperty('pactProvider') ? pactProvider : project.name
def pactProtocol = project.hasProperty('pactProtocol') ? pactProtocol : 'http'
def pactHost = project.hasProperty('pactHost') ? pactHost : 'localhost'
def pactPort = project.hasProperty('pactPort') ? pactPort : '8080'
pact {
serviceProviders {
// You can define as many as you need, but each must have a unique name
"${providerName}" {
// All the provider properties are optional, and have sensible defaults (shown below)
protocol = pactProtocol
host = pactHost
port = pactPort
path = '/'
if ('pactVerify' in gradle.startParameter.taskNames) {
hasPactsFromPactBroker(pactBrokerUrl)
}
}
}
}