Skip to content

Instantly share code, notes, and snippets.

@tbje
Created July 7, 2010 08:20
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 tbje/466462 to your computer and use it in GitHub Desktop.
Save tbje/466462 to your computer and use it in GitHub Desktop.
// jetty6 imports
import org.mortbay.jetty.webapp.{WebAppClassLoader, WebAppContext, WebInfConfiguration, Configuration, FragmentConfiguration, JettyWebXmlConfiguration, TagLibConfiguration, WebXmlConfiguration}
import org.mortbay.xml.XmlConfiguration
import org.mortbay.jetty.plus.webapp.{EnvConfiguration, Configuration=>PlusConfiguration}
// jetty7 imports
import org.eclipse.jetty.webapp.{WebAppClassLoader, WebAppContext, WebInfConfiguration, Configuration, FragmentConfiguration, JettyWebXmlConfiguration, TagLibConfiguration, WebXmlConfiguration}
import org.eclipse.xml.XmlConfiguration
import org.eclipse.jetty.plus.webapp.{EnvConfiguration, Configuration=>PlusConfiguration}
// ...
val webapp = new WebAppContext(war.absolutePath, contextPath)
// ...
val envConfig = new EnvConfiguration
envConfig.setJettyEnvXml(jettyEnvFile.toURL)
val confArray : Array[Configuration] = Array(
new WebInfConfiguration,
new WebXmlConfiguration,
envConfig,
new PlusConfiguration,
new JettyWebXmlConfiguration,
new TagLibConfiguration
)
webapp.setConfigurations(confArray)
class MyProject(info: ProjectInfo) extends DefaultWebProject(info){
<!-- Your dependencies here -->
val jetty7WebApp = "org.eclipse.jetty" % "jetty-webapp" % "7.0.2.RC0" % "test"
val jetty7Server = "org.eclipse.jetty" % "jetty-server" % "7.0.2.RC0" % "test"
val jetty7Plus = "org.eclipse.jetty" % "jetty-plus" % "7.0.2.RC0" % "test"
<!-- Path to jetty-env.xml -->
override def jettyEnvXml = Some(
(sourcePath / "main" / "jetty" / "jetty-env.xml").asFile
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment