Tony Giaccone
Tony Giaccone

Reputation: 511

Configuring jetty at start up to not scan jar files and speed up deployment.

I'm working on an embedded jetty web app, where we start the application from the jar file, and we want to prevent the classpath scan that occurs on startup that slows down the start up process.

To do using xml is outlined in the eclipse document here:

http://wiki.eclipse.org/Jetty/Howto/Avoid_slow_deployment

on that page it says, "in code by calling...."

I've looked over the API fro WebAppContext and there's not much there about how to configure the context to not do the can, but based on the statement:

"Context attributes can be set for a single webapp"

I tried the following:

 WebAppContext servletContext = new WebAppContext();
 servletContext.setAttribute("org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern", "^$");

However, that doesn't seem to work. Does anyone have an effective solution to how to configure the webappcontext so that it DOES NOT, scan those jar files?

Upvotes: 4

Views: 1565

Answers (1)

Mike Christianson
Mike Christianson

Reputation: 2027

Perhaps try removeAttribute() instead?

WebAppContext servletContext = new WebAppContext();
servletContext.removeAttribute("org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern");

Upvotes: 1

Related Questions