Skip to content
Browse files

changes to make work with embedded jetty instead of xsbt-web-plugin

  • Loading branch information...
1 parent 4cbf8de commit f87cda7038185f49d41efc27fa3982c513df3ce5 @casualjim casualjim committed Feb 18, 2012
Showing with 36 additions and 3 deletions.
  1. +2 −2 src/main/g8/build.sbt
  2. +0 −1 src/main/g8/project/plugins.sbt
  3. +34 −0 src/main/g8/src/main/scala/$package$/JettyMain.scala
View
4 src/main/g8/build.sbt
@@ -13,8 +13,8 @@ libraryDependencies ++= Seq(
"org.scalatra" %% "scalatra-scalate" % "2.0.3",
"org.scalatra" %% "scalatra-specs2" % "2.0.3" % "test",
"ch.qos.logback" % "logback-classic" % "1.0.0" % "runtime",
- "org.eclipse.jetty" % "jetty-webapp" % "7.5.4.v20111024" % "container",
- "javax.servlet" % "servlet-api" % "2.5" % "provided"
+ "org.eclipse.jetty" % "jetty-webapp" % "7.6.0.v20120127",
+ "javax.servlet" % "servlet-api" % "2.5"
)
resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
View
1 src/main/g8/project/plugins.sbt
@@ -1 +0,0 @@
-libraryDependencies <+= sbtVersion(v => "com.github.siasia" %% "xsbt-web-plugin" % (v+"-0.2.10"))
View
34 src/main/g8/src/main/scala/$package$/JettyMain.scala
@@ -0,0 +1,34 @@
+package $package$
+
+import org.eclipse.jetty.server.nio.SelectChannelConnector
+import org.eclipse.jetty.server.{ Server }
+import org.eclipse.jetty.server.handler.ContextHandlerCollection
+import org.eclipse.jetty.webapp.WebAppContext
+import org.eclipse.jetty.servlet.{ DefaultServlet, ServletContextHandler, ServletHolder }
+
+object JettyMain {
+
+ def main(args: Array[String]) = {
+ val server: Server = new Server
+
+ server setGracefulShutdown 5000
+ server setSendServerVersion false
+ server setSendDateHeader true
+ server setStopAtShutdown true
+
+ val connector = new SelectChannelConnector
+ connector setPort 8080
+ connector setMaxIdleTime 90000
+ server addConnector connector
+
+ val webapp = "src/main/webapp"
+ val webApp = new WebAppContext
+ webApp setContextPath "/"
+ webApp setResourceBase webapp
+ webApp setDescriptor (webapp+"/WEB-INF/web.xml");
+
+ server setHandler webApp
+
+ server.start()
+ }
+}

0 comments on commit f87cda7

Please sign in to comment.
Something went wrong with that request. Please try again.