File webappDir = new File(baseDir, "webapps");
webappDir.mkdirs();
Tomcat tomcat = new Tomcat();
tomcat.setBaseDir(baseDir.getPath());
tomcat.setPort(9080);
tomcat.enableNaming();
Connector connector = tomcat.getConnector();
// see https://issues.apache.org/bugzilla/show_bug.cgi?id=50360
connector.setProperty("bindOnInit", "false");
Host host = tomcat.getHost();
host.setDeployOnStartup(false);