Created
March 25, 2012 15:45
-
-
Save ttddyy/2197625 to your computer and use it in GitHub Desktop.
run jetty on dependency resolved war file in gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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