task.setIn(resources.toArray(new String[resources.size()]));
task.setOut(new String[] { "output.js", "output.css" });
task.setOptionsDefinition(options);
final ProcessorFactory processorFactory = new JavaEEProcessorFactory();
try {
final VFS vfs = new VFS();
try {
vfs.mount(vfs.find("/"), new ServletFile(getServletContext(), "/"));
this.result = new Pipeline(processorFactory).execute(
Version.getCurrentVersion(), vfs, new VFSResourceResolver(vfs),
task);
} finally {
vfs.dispose();
}
} catch (final IOException e) {
throw new ServletException("Failed to setup vfs", e);
} finally {
processorFactory.dispose();