Jetty Plugin

  • Tags : server
  • Latest : 2.0.3
  • Last Updated: 20 February 2013
  • Grails version : 2.0 > *
3 votes
Dependency :
compile ":jetty:2.0.3"

Documentation Source Issues


Makes Jetty the development time container for Grails


Remove the dependency in BuildConfig.groovy for the Tomcat plugin and add this in its place:

build ':jetty:2.0.3'


Makes Jetty 7.6.0 the development time container for Grails


info 'org.eclipse.jetty'

to your application's Config.groovy log4j section to see the Jetty information and errors.

Multiple applications

You can run additional applications in WAR format by adding this code to your application's scripts/_Events.groovy:

import org.eclipse.jetty.server.Server
import org.eclipse.jetty.server.handler.ContextHandlerCollection
import org.eclipse.jetty.webapp.WebAppContext
import org.eclipse.jetty.server.Handler

eventConfigureJetty = { Server server -> try { // add as many wars to this map as you want def wars = [other: "/path/to/otherapplication.war"]

def handlers = [server.handler] wars.each { context, filePath -> handlers << new WebAppContext(filePath, "/$context") }

server.handler = new ContextHandlerCollection(handlers: handlers as Handler[]) } catch (e) { e.printStackTrace() } }