Skip to content

Instantly share code, notes, and snippets.

@ttddyy
Created March 25, 2012 15:45
Show Gist options
  • Save ttddyy/2197625 to your computer and use it in GitHub Desktop.
Save ttddyy/2197625 to your computer and use it in GitHub Desktop.
run jetty on dependency resolved war file in gradle
// Run Jetty on dependency resolved war file
//
// you can run multiple wars with different configuration by
// adding more task definitions.
//
import org.gradle.api.plugins.jetty.JettyRunWar
apply plugin: 'java'
apply plugin: 'jetty'
repositories {
mavenCentral()
}
configurations {
// define custom dependency configuration for war file
myWebApp
}
dependencies {
// add war file dependency to my custom configuration
myWebApp "org.some:my-app:1.0@war"
}
task runMyWebApp(type: JettyRunWar) {
// specify the resolved war file
webApp = configurations.myWebApp.singleFile
// more configuration
httpPort = 8001
contextPath = 'myWebApp'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment