Hi

I was wondering if its possible to have the annotation scanner scan for
classes outside jar resources.


I have this class in test scope of my war project.
System.setProperty("org.eclipse.jetty.LEVEL", "INFO");

Server srv = new Server(8080);
srv.setStopAtShutdown(true);

Configuration.ClassList classlist =
Configuration.ClassList.setServerDefault(srv);
classlist.addBefore("org.eclipse.jetty.webapp.JettyWebXmlConfiguration",
"org.eclipse.jetty.annotations.AnnotationConfiguration");

WebAppContext context = new WebAppContext();
context.setContextPath("/");

String dir;
if (new File("src/main/webapp").exists()) dir = "src/main/webapp";
else dir = "war/src/main/webapp";

context.setResourceBase(dir);
context.setDescriptor(dir + "/WEB-INF/web.xml");

context.setAttribute(
"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
".*/[^/]*servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/[^/]*taglibs.*\\.jar
quot;);

context.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed",
"false");

context.setParentLoaderPriority(true);
context.setServer(srv);

// Add the handlers
HandlerList handlers = new HandlerList();
handlers.addHandler(context);
srv.setHandler(handlers);

srv.start();
srv.join();


And want to have this one scan main classes for annotations.


-- 
Idar Borlaug
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to