Created
January 16, 2012 03:14
-
-
Save aolshevskiy/1618850 to your computer and use it in GitHub Desktop.
Multiple webapp resource dirs with Gradle-embed Jetty
This file contains hidden or 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
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")) | |
} |
This file contains hidden or 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
import org.mortbay.resource.ResourceCollection | |
new ResourceCollection(resources) |
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
This is very useful ! Thanks !