Skip to content
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

Allow setting java_opts only #343

Merged
merged 11 commits into from
Oct 29, 2024
11 changes: 10 additions & 1 deletion templates/domain.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ fi
# Specify options to pass to the Java VM.
#
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms<%= $wildfly::java_xms %> -Xmx<%= $wildfly::java_xmx %> -XX:MaxMetaspaceSize=<%= $wildfly::java_maxmetaspace_size %>"
JAVA_OPTS=$JAVA_OPTS"
<%- unless $wildfly::java_xms == '' { -%>
JAVA_OPTS="$JAVA_OPTS -Xms <%= $wildfly::java_xms %>"
<%- } -%>
<%- unless $wildfly::java_xmx == '' { -%>
JAVA_OPTS="$JAVA_OPTS -Xmx <%= $wildfly::java_xmx %>"
<%- } -%>
<%- unless $wildfly::java_maxmetaspace_size == '' { -%>
JAVA_OPTS="$JAVA_OPTS -XX:MaxMetaspaceSize=<%= $wildfly::java_maxmetaspace_size %>"
<%- } -%>
JAVA_OPTS="$JAVA_OPTS <% if $wildfly::java_opts =~ Array { -%>
<%= $wildfly::java_opts.join(" ") -%>
<% } elsif $wildfly::java_opts =~ String { -%>
Expand Down
17 changes: 15 additions & 2 deletions templates/standalone.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,21 @@ fi
# Specify options to pass to the Java VM.
#
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms<%= $wildfly::java_xms %> -Xmx<%= $wildfly::java_xmx %> -XX:MaxMetaspaceSize=<%= $wildfly::java_maxmetaspace_size %>"
JAVA_OPTS="$JAVA_OPTS <%= $wildfly::java_opts %>"
JAVA_OPTS="$JAVA_OPTS"
<%- unless $wildfly::java_xms == '' { -%>
JAVA_OPTS="$JAVA_OPTS -Xms<%= $wildfly::java_xms %>"
<%- } -%>
<%- unless $wildfly::java_xmx == '' { -%>
JAVA_OPTS="$JAVA_OPTS -Xmx<%= $wildfly::java_xmx %>"
<%- } -%>
<%- unless $wildfly::java_maxmetaspace_size == '' { -%>
JAVA_OPTS="$JAVA_OPTS -XX:MaxMetaspaceSize=<%= $wildfly::java_maxmetaspace_size %>"
<%- } -%>
JAVA_OPTS="$JAVA_OPTS <% if $wildfly::java_opts =~ Array { -%>
<%= $wildfly::java_opts.join(" ") -%>
<% } elsif $wildfly::java_opts =~ String { -%>
<%= $wildfly::java_opts -%>
<% } -%>"
else
echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
fi
Expand Down