-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make JPMS parameters work with and without enabling Jetty JPMS mode #151
Comments
I think points 1 and 3 are issues for jetty.project, but number 2 can be fixed here. For point 1 we have to first take docker out of the equation. If you can't use
This produces a command where the
And doing this without quotes:
Treats |
Signed-off-by: Lachlan Roberts <[email protected]>
@lachlan-roberts Thanks for your reply. I think for point 1. the docker image could also implement a workaround until Currently the echo "exec " $JAVA $JAVA_OPTIONS "$@" $JAVA_OPTIONS $JETTY_PROPERTIES > $JETTY_BASE/jetty.exec First I don't see the point why Anways, the entry point could be changed to echo "exec " $JAVA $JAVA_OPTIONS "$@" $JETTY_PROPERTIES > $JETTY_BASE/jetty.exec to avoid passing Later once |
This is a two split issue from end user perspective. Some need to be fixed in the docker image and some in jetty itself. The main goal is to make JPMS useable.
Consider a web application that has some old libraries (before JPMS) and newer ones that may or may not have JPMS metadata. Yet the application needs some
--add-opens
parameter to make some libraries work properly.Migrating to the official jetty docker image has the following issues:
Nearly every java based docker image has a
JAVA_OPTIONS
env variable that is passed to the final JVM being executed in the container as is. A Dockerfile likeshould just work without issues. However the above results in a
jetty.start
file that contains (spaces replaced with newline for readability)This command is broken because the single
--add-opens
does not have a parameter value and the remaining--add-opens
are swallowed completely.Using a custom jetty module to use JPMS as envisioned by jetty would look like
However after activating such a module the
--dry-run
command emits a command line that contains--module org.eclipse.jetty.xml/org.eclipse.jetty.xml.XmlConfiguration
. Thegenerate-jetty-start.sh
script executes a regex on the--dry-run
output and that regex filters the emitted command line resulting injetty.start
being empty and the container fails to start. The regex always searches fororg.eclipse.jetty.xml.XmlConfiguration
surrounded by a single space character which is not given in JPMS mode. See regex at: https://github.com/eclipse/jetty.docker/blob/992eabbc38b2694207852286b15623dc18e67978/eclipse-temurin/10.0/jdk17/generate-jetty-start.sh#L8C3-L10C56In my opinion a custom jetty module should also allow defining JPMS parameters in the
[exec]
block because there are situations you do not want to fully enable JPMS by using module-path but still want to open some packages for reflection. This could be done usingJAVA_OPTIONS
if 1. is fixed but I think it is still valid to have a custom module that should work the same.However the above fails because all
--add-opens
parameters will be deduplicated resulting in a broken command line again (spaces replaced with newline for readability):This is also tracked in
--dry-run
generates broken command line when using multiple--add-opens
in an[exec]
module jetty.project#8348 and there was a workaround for it before jetty introduced quotes on parameters. Now with quotes this workaround does not work anymore. I repeated that issue here to have a full view of the usability problems.The text was updated successfully, but these errors were encountered: