liberty-bikes/build.gradle
2017-12-15 14:35:48 -06:00

55 lines
1.0 KiB
Groovy

apply plugin: 'liberty'
apply plugin: 'war'
sourceCompatibility = 1.8
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.wasdev.wlp.gradle.plugins:liberty-gradle-plugin:2.0.1'
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'javax:javaee-api:7.0'
libertyRuntime 'io.openliberty:openliberty-runtime:17.0.0.3'
}
ext {
httpPort = 8080
httpsPort = 8443
}
liberty {
server {
name = 'tronServer'
dropins = [war]
bootstrapProperties = ['httpPort': httpPort, 'httpsPort': httpsPort]
}
}
libertyStart.dependsOn 'libertyStop'
libertyRun.dependsOn 'libertyStop'
task openBrowser {
description = 'Opens a web browser to http://localhost:${httpPort}/'
doLast {
java.awt.Desktop.desktop.browse "http://localhost:${httpPort}/".toURI()
}
}
gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(":libertyStart")) {
libertyStart.doLast {
println ("Application is running on http://localhost:${httpPort}/")
}
}
}