Skip to content

Instantly share code, notes, and snippets.

@orangeclover
Created October 28, 2013 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orangeclover/7196371 to your computer and use it in GitHub Desktop.
Save orangeclover/7196371 to your computer and use it in GitHub Desktop.
GradleからPostgreSQL StudioのWarファイルをダウロードしてJetty上で動作させる
apply plugin: 'war'
apply plugin: 'jetty'
war {
baseName = 'pgstudio'
archiveName = "pgstudio.war"
from 'war'
}
httpPort = 8080
stopPort = 9451
stopKey = 'foo'
def zipFile =''
task downloadZip(type: MyDownload) {
sourceUrl = 'http://www.postgresqlstudio.org/?ddownload=839'
target = file("${temporaryDir}/pgstudio.war")
zipFile = target
}
class MyDownload extends DefaultTask {
@Input
String sourceUrl
@OutputFile
File target
@TaskAction
void download() {
ant.get(src: sourceUrl, dest: target)
}
}
task unzip(type: Copy) {
def outputDir = file("build/libs")
from zipTree(zipFile)
into outputDir
}
task deploy {
dependsOn downloadZip,unzip
}
task warRun {
war.enabled = false
dependsOn jettyRunWar
}
@orangeclover
Copy link
Author

説明を書いてるブログはこちら。
『GradleからPostgreSQL StudioのWarファイルをダウロードしてJetty上で動作させる』 http://orangeclover.hatenablog.com/entry/2013/10/28/222719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment