My game is a full on server/client app, so I'm not sure how exactly to remove jetty from the WEB-INF/lib without breaking the game. The index.html file for the game loads resources then opens a websocket to the jetty server from which it was just served. The server code in the app has a websocket listener that processes all the communication from the client as players play the game. In production, the app is served from a jetty service that simply loads up the game's .war file and goes.
In testing, I just want to simulate the server by loading the war file directory programatically. The test server looks like this:
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
public final class WebSocketServer {
public static void main (String[] args) throws Exception {
Server server = new Server(8081);
WebAppContext context = new WebAppContext();
context.setDescriptor("/tacan-app/war/WEB-INF/web.xml");
context.setResourceBase("/tacan-app/war");
context.setContextPath("/game");
context.setParentLoaderPriority(true);
server.setHandler(context);
server.start();
server.join();
}
}