-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
68 lines (56 loc) · 1.36 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
plugins {
id("io.openliberty.tools.gradle.Liberty").version("3.8.3")
id("war")
id("groovy")
}
version = "0.1"
dependencies {
annotationProcessor(libs.lombok)
providedCompile(libs.javaee.api)
providedCompile(libs.jaxb.api)
compileOnly(libs.lombok)
compileOnly(libs.jetbrains.annotations)
implementation(project(":grooves-java"))
implementation(project(":grooves-example-test"))
implementation(libs.slf4j.api)
implementation(libs.lang3)
implementation(libs.rxjava.core)
implementation(libs.rxjava.reactivestreams)
libertyFeature(libs.liberty.jaxrs)
}
liberty {
server {
features {
name = ["jaxrs-2.1"]
}
}
}
libertyRun.dependsOn("war")
libertyStart.dependsOn("war")
int statusOfUrl(String url) {
int status = -1
try {
content = url.toURL().openConnection().with { conn ->
readTimeout = 10000
status = responseCode
}
} catch (Exception ignore) {
// ignore
}
status
}
libertyStart.doLast {
int attempt = 0
while (attempt < 20) {
println "Waiting (${++attempt})..."
if (statusOfUrl("http://localhost:9080/grooves-example-javaee/patient") == 200) {
break
}
sleep 5000
}
}
test.dependsOn("libertyStart")
test.finalizedBy("libertyStop")
test {
useJUnitPlatform()
}