forked from cokeSchlumpf/sample.ferret
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
68 lines (55 loc) · 1.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
apply plugin: 'war'
apply plugin: 'liberty'
group = 'net.wasdev.wlp.sample'
version = '1.3-SNAPSHOT'
description = "Liberty Sample - Ferret"
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'net.wasdev.wlp.gradle.plugins:liberty-gradle-plugin:2.0'
}
}
repositories {
mavenCentral()
}
war {
archiveName = baseName + '.' + extension
}
ext {
// Liberty server properties
wlpServerName = 'LibertyProjectServer'
testServerHttpPort = 9080
testServerHttpsPort = 9443
warContext = 'ferret'
}
dependencies {
providedCompile group: 'org.apache.geronimo.specs', name: 'geronimo-servlet_3.0_spec', version:'1.0'
libertyRuntime group: 'com.ibm.websphere.appserver.runtime', name: 'wlp-webProfile7', version: '17.0.0.2'
}
liberty {
server {
configFile = file('src/main/wlp/server.xml')
bootstrapProperties = ['appLocation': war.baseName]
name = wlpServerName
apps = [war]
}
}
gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(":libertyStart") && !graph.hasTask(":libertyStop")) {
// Doesn't know if libertyStart succeeds or not
libertyStart.doLast {
println ("The server should be running on: http://localhost:${testServerHttpPort}/${warContext}")
}
}
}
clean.dependsOn 'libertyStop'
check.dependsOn 'libertyStart'
check.finalizedBy 'libertyStop'