1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | public final class StartServer {
private StartServer() { }
public static void main(String[] args) throws Exception { // We will set the basedir Systemproperty accordingly when running the Program // Actually the mavenplugin appassembler will do this for us String basedir = System.getProperty("basedir"); String webappLocation = new File(basedir + "/webapp").getAbsolutePath(); int port = 8080;
Tomcat tomcat = new Tomcat(); tomcat.setPort(port); tomcat.addWebapp("/", webappLocation); tomcat.start(); tomcat.getServer().await(); } }
|