You most definately should be using 2 separate directories.
(repeated here for others that see this question in the future)
The jetty.home
directory.
This is for the jetty distribution (or the more modern jetty-home
tarball/zip).
The jetty.home
directory is sacred, don't edit/change/remove/add/modify ANYTHING in this directory. You don't need to, for any possible configuration you can come up with (trust me).
The jetty.base
directory.
This is the directory for your configuration, or instance of Jetty.
Make sure this directory does not nest inside/outside of the jetty.home
directory, you'll just make your life needless complicated when it's time to upgrade (or even downgrade) your Jetty version.
Next, when it comes to initialization, turn off nuhup
, that just hides any errors you might have during initialization. The --add-module
command is terminal anyway and will do what it needs and then exit, it's not a daemon and keeps running. If you don't want to see the output, at least redirect it to an output file you can interrogate if there's issues.
Don't put it in the background either (the &
at the end), the exit code will be useful to you if an error occurs.
aka
java -jar /path/to/jetty-home/start.jar \
jetty.home=/path/to/jetty-home \
jetty.base=/path/to/my-jetty-base \
--add-module=http,deploy,annotations,logging-jetty,jsp \
2>&1 > /path/to/my-jetty-base/jetty-init.log
Keep in mind that some modules, when added, require user interaction (to accept licenses). This can be handled in scripts by using the --approve-all-licenses
option on start.jar
.
Lastly, are you sure ansible supports the "Jakarta Big Bang" namespace changes that Jetty 11 implements?
See past answer on this: https://stackoverflow.com/a/66368511/775715
If ansible has updated to Jakarta EE 9, then go ahead and use Jetty 11, if they haven't, then stick with Jetty 10 (which is on Jakarta EE 8) until such time that ansible catches up with the rest of the world.