in netbeans.apache.org/buildSrc/src/main/groovy/TomcatMain.groovy [54:69]
public void run() {
final Tomcat tomcat = new Tomcat()
tomcat.port = port
tomcat.server.port = shutdownPort
StandardContext ctx = (StandardContext) tomcat.addWebapp("", directory.absolutePath)
println("Configuring tomcat with basedir ${directory.absolutePath} and port ${port}")
WebResourceRoot resources = new StandardRoot(ctx);
resources.addPreResources(new EmptyResourceSet(resources));
ctx.setResources(resources);
tomcat.start();
tomcat.server.await()
}