This repository has been archived by the owner on Jun 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.gradle
91 lines (75 loc) · 1.91 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
apply plugin: 'war'
apply plugin: 'liberty'
group = 'net.wasdev.sample'
version = '1.0-SNAPSHOT'
description = "PlantsByWebSphere"
sourceCompatibility = 1.7
targetCompatibility = 1.7
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.wasdev.wlp.gradle.plugins:liberty-gradle-plugin:2.6.5'
}
}
repositories {
mavenCentral()
}
configurations {
serverLibs
}
dependencies {
providedCompile 'javax:javaee-api:7.0'
serverLibs 'org.apache.derby:derby:10.11.1.1'
libertyRuntime 'com.ibm.websphere.appserver.runtime:wlp-javaee7:19.0.0.8'
}
task copyServerLibs(type: Copy) {
shouldRunAfter 'libertyCreate'
from configurations.serverLibs
into "${buildDir}/wlp/usr/servers/${rootProject.name}Server/lib"
}
war.archiveName "${rootProject.name}.war"
test.dependsOn 'war'
test {
defaultCharacterEncoding = "UTF-8"
useJUnitPlatform()
testLogging {
displayGranularity 1
showStandardStreams = true
showStackTraces = true
exceptionFormat = 'full'
events 'PASSED', 'FAILED', 'SKIPPED'
}
}
ext {
appUrl = "http://localhost:9080/${rootProject.name}/"
}
liberty {
server {
name = rootProject.name + 'Server'
dropins = [war]
looseApplication = false
configDirectory = file('src/main/liberty/config')
}
}
task openBrowser {
description = "Open browser to ${appUrl}"
doLast {
java.awt.Desktop.desktop.browse "${appUrl}".toURI()
}
}
clean.dependsOn 'libertyStop'
libertyPackage.dependsOn 'libertyStop', 'copyServerLibs'
libertyStart.dependsOn 'libertyStop', 'copyServerLibs'
libertyRun.dependsOn 'libertyStop'
libertyStart.doLast {
println "Application available at: ${appUrl}"
}
libertyStart.dependsOn 'libertyStop'
libertyRun.dependsOn 'libertyStop'
task start { dependsOn 'libertyStart' }
task stop { dependsOn 'libertyStop' }