From da4f3ceb1fc1f317a3cca788b6c9b78ffab12de2 Mon Sep 17 00:00:00 2001 From: Kostya Date: Tue, 13 Oct 2026 19:19:40 +0300 Subject: tools: package the server as a WAR and the client as a directory The Ex3 submission is exactly one WAR for Tomcat's webapps/ plus a directory holding the client, its jars and its batch file. package.sh now stages both under build/dist/ex3. The WAR is named guess-market.war after the context path the client expects, and carries the api and service jars with gson and JAXB; Tomcat only has to provide the servlet API. The client directory holds ui-client, api, ui-fx, gson, OkHttp and JavaFX, and nothing of the engine. An executable's Class-Path used to name every module. List only the modules it depends on, so the client jar no longer points at service.jar, and stop producing a plain jar for the server module. Add tomcat.sh to try the result by hand: it copies the packaged WAR into a local Tomcat ($CATALINA_HOME, or the newest C:\tomcat\apache-tomcat-*) and runs it in the foreground. --- tools/_util.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tools/_util.sh') diff --git a/tools/_util.sh b/tools/_util.sh index 65cba8c..8323c61 100644 --- a/tools/_util.sh +++ b/tools/_util.sh @@ -22,6 +22,14 @@ MAINCLASS_ui_console="market.guess.ui.console.App" MAINCLASS_ui_desktop="market.guess.ui.desktop.Launcher" MAINCLASS_ui_client="market.guess.ui.client.Launcher" +# Exercise 3 submission: one WAR for Tomcat's webapps/ and a self-contained client directory. +# The WAR is named after the context path the client expects (/guess-market). +WAR_MODULE="server" +WAR_NAME="guess-market" +WAR_LIB_DIRS="gson jaxb" +CLIENT="ui-client" +CLIENT_LIB_DIRS="gson openjfx okhttp" + JAVA_HOME_DIR=$(java -XshowSettings:properties -version 2>&1 | tr -d '\r' | sed -n 's/^ *java\.home = //p') case "$(uname -s)" in CYGWIN*|MINGW*|MSYS*) -- cgit v1.2.3