Skip to content

Instantly share code, notes, and snippets.

@mike-neck
Created June 3, 2019 05:56
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 mike-neck/82975a332131ae7644915f7d3006894b to your computer and use it in GitHub Desktop.
Save mike-neck/82975a332131ae7644915f7d3006894b to your computer and use it in GitHub Desktop.
Jetty で JAX-RS1
plugins {
id 'java'
id 'war'
}
repositories {
mavenLocal()
mavenCentral()
}
configurations {
jetty
}
dependencies {
compile 'com.sun.jersey:jersey-servlet:1.19.4'
compile 'com.sun.jersey:jersey-json:1.19.4'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.6'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6'
compile group: 'org.eclipse.collections', name: 'eclipse-collections', version: '9.2.0'
compile group: 'net.moznion', name: 'gimei', version: '1.3.0'
compile 'org.slf4j:slf4j-api:1.7.25'
compile 'ch.qos.logback:logback-classic:1.2.3'
jetty 'org.eclipse.jetty:jetty-runner:9.4.11.v20180605'
}
task runJetty(type: JavaExec, group: 'application', dependsOn: 'war') {
classpath = configurations.jetty
main = 'org.eclipse.jetty.runner.Runner'
args '--port', '9080', tasks.war.outputs.files.singleFile
}
task downloadJetty(type: Copy, group: 'application', dependsOn: 'war') {
from configurations.jetty
into "$buildDir/jetty"
}
task jettyCommand(group: 'application', dependsOn: 'war') {
doLast {
println "java -classpath ${configurations.jetty.asPath} org.eclipse.jetty.runner.Runner --port 9080 ${tasks.war.outputs.files.singleFile}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment