You should set following 2 options. server.setStopAtShutdown(true); server.setStopTimeout(7_000); setStopAtShutdown sets code Runtime.getRuntime().addShutdownHook to stop Jetty at JVM shutdown phase. ref. https://github.com/eclipse/jetty.project/blob/master/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ShutdownThread.java setStopTimeout is required. Without this option, Jetty kills all co