jettyjetty-12

Jetty 12 development mode


Is there a way with Jetty 12 to use the existing work directory modifications to jar files or class files without have jetty re-explode the war in the webapps directory during startup?

I added these modules when I created my startd.

alpn-java,ee10-jsp,ee10-jstl,ee10-security,ee10-servlet,ee10-servlets,ee10-webapp,ee10-websocket-jakarta,ee10-websocket-jetty-client-webapp,ext,gzip,http,http-forwarded,http2,https,jndi,requestlog,rewrite,server,sessions,threadlimit,work,ee10-deploy,ssl,console-capture

The modules are left as default with not extra options enabled. i place the war in the war directory. The war exploded in the work directory. I stop the server. I update jar and/or class files in the work directory. When I start the server, the WAR is re-extracted by jetty and the class and jar files get overwritten with the modifications I made in the work directory.

How do I prevent it from re-exploding the war? Jetty 9.x didn't do this. I'm using Jetty 12.0.15 when this happens.


Solution

  • The answer can be found at this link, github.com/jetty/jetty.project/issues/12938.

    This is what was posted in the link by joakime

    "If the work directory contents do not match the WAR it's re-extracted.
    If you don't want this behavior, then don't use WAR deployment, use Directory deployment.
    Just unpack the WAR into a directory in ${jetty.base}/webapps/<appname>/ and use that as the main deployment. (just don't put the WAR file in ${jetty.base}/webapps/)"

    Though, I would've like an option for altering the work directory in scenarios where code needs to be altered for debugging or other critical scenarios that are not repeatable in other server environments.