Skip to content

Instantly share code, notes, and snippets.

@aolshevskiy
Created January 16, 2012 03:14
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aolshevskiy/1618850 to your computer and use it in GitHub Desktop.
Save aolshevskiy/1618850 to your computer and use it in GitHub Desktop.
Multiple webapp resource dirs with Gradle-embed Jetty
import org.gradle.api.plugins.jetty.internal.JettyPluginWebAppContext
apply plugin: "jetty"
def newResourceCollection(File... resources) {
shell = new GroovyShell(JettyPluginWebAppContext.class.classLoader)
shell.setProperty("resources", resources as String[])
return shell.evaluate(file("resource_collection.groovy"))
}
jettyRun.doFirst {
jettyRun.webAppConfig = new JettyPluginWebAppContext()
jettyRun.webAppConfig.baseResource = newResourceCollection(
file("src/test/webapp"),
file("src/main/webapp"))
}
import org.mortbay.resource.ResourceCollection
new ResourceCollection(resources)
@monzou
Copy link

monzou commented Apr 2, 2013

This is very useful ! Thanks !

@longkai
Copy link

longkai commented Aug 10, 2013

i just copy the two in one of webapp project, but did not work.the other web project is war plugin. can you give some advice?

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