Skip to content

Commit

Permalink
LPD-15684 Unify JDK_JAVA_OPTIONS settings for all appservers. We need…
Browse files Browse the repository at this point in the history
… this separate settings to automatically pass settings to sidecar jvm.
  • Loading branch information
shuyangzhou authored and brianchandotcom committed Jan 28, 2024
1 parent cd203aa commit 4ce3a8f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 9 deletions.
7 changes: 7 additions & 0 deletions app.server.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
## Server JVM Settings
##

app.server.jdk.java.options=--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=jdk.zipfs/jdk.nio.zipfs=ALL-UNNAMED
app.server.jvm.mem=-Xms2560m -Xmx2560m -XX:MaxNewSize=1536m -XX:MaxMetaspaceSize=768m -XX:MetaspaceSize=768m -XX:NewSize=1536m -XX:SurvivorRatio=7
app.server.jvm.args=-Dfile.encoding=UTF-8 -Djava.locale.providers=JRE,COMPAT,CLDR -Djava.net.preferIPv4Stack=true -Duser.timezone=GMT

Expand All @@ -41,6 +42,7 @@
app.server.jboss.classes.portal.dir=${app.server.jboss.portal.dir}/WEB-INF/classes
app.server.jboss.deploy.dir=${app.server.jboss.instance.dir}/deployments
app.server.jboss.instance.dir=${app.server.jboss.dir}/standalone
app.server.jboss.jdk.java.options=${app.server.jdk.java.options} --add-opens=java.base/java.util=ALL-UNNAMED
app.server.jboss.jvm.mem=${app.server.jvm.mem}
app.server.jboss.jvm.args=${app.server.jvm.args} -Djboss.as.management.blocking.timeout=1800
app.server.jboss.lib.global.dir=${app.server.jboss.dir}/modules/com/liferay/portal/main
Expand All @@ -65,6 +67,7 @@
app.server.tcserver.classes.portal.dir=${app.server.tcserver.portal.dir}/WEB-INF/classes
app.server.tcserver.deploy.dir=${app.server.tcserver.dir}/instances/liferay/webapps
app.server.tcserver.developer.dir=${app.server.tcserver.dir}/developer-${app.server.tcserver.version}.RELEASE
app.server.tcserver.jdk.java.options=${app.server.jdk.java.options}
app.server.tcserver.jvm.mem=${app.server.jvm.mem}
app.server.tcserver.jvm.args=${app.server.jvm.args}
app.server.tcserver.lib.global.dir=${app.server.tcserver.dir}/instances/liferay/lib
Expand All @@ -90,6 +93,7 @@
app.server.tomcat.classes.global.dir=${app.server.tomcat.dir}/lib
app.server.tomcat.classes.portal.dir=${app.server.tomcat.portal.dir}/WEB-INF/classes
app.server.tomcat.deploy.dir=${app.server.tomcat.dir}/webapps
app.server.tomcat.jdk.java.options=${app.server.jdk.java.options}
app.server.tomcat.jvm.mem=${app.server.jvm.mem}
app.server.tomcat.jvm.args=${app.server.jvm.args}
app.server.tomcat.lib.global.dir=${app.server.tomcat.dir}/lib/ext
Expand Down Expand Up @@ -119,6 +123,7 @@
app.server.weblogic.instance.dir=${app.server.weblogic.dir}/domains/${app.server.weblogic.instance.name}
app.server.weblogic.instance.name=liferay
app.server.weblogic.jar.name=fmw_${app.server.weblogic.version}.3.0_wls_quick.jar
app.server.weblogic.jdk.java.options=${app.server.jdk.java.options}
app.server.weblogic.jvm.mem=${app.server.jvm.mem}
app.server.weblogic.jvm.args=${app.server.jvm.args}
app.server.weblogic.lib.global.dir=${app.server.weblogic.instance.dir}/lib
Expand Down Expand Up @@ -165,6 +170,7 @@
app.server.websphere.deploy.dir=${app.server.websphere.instance.dir}/wsadmin-deploy
app.server.websphere.fix.pack.was.zip.names=9.0.0-WS-WAS-FP007.zip
app.server.websphere.fix.pack.zip.url=http://www-01.ibm.com/support/docview.wss?uid=swg24044620
app.server.websphere.jdk.java.options=${app.server.jdk.java.options}
app.server.websphere.jdk.zip.names=ibm-java-sdk-8.0-5.11-linux-x64-installmgr.zip
app.server.websphere.jdk.zip.url=http://www-01.ibm.com/support/docview.wss?uid=swg27048319
app.server.websphere.installation.manager.version=1.8.9.0
Expand Down Expand Up @@ -220,6 +226,7 @@
app.server.wildfly.classes.portal.dir=${app.server.wildfly.portal.dir}/WEB-INF/classes
app.server.wildfly.deploy.dir=${app.server.wildfly.instance.dir}/deployments
app.server.wildfly.instance.dir=${app.server.wildfly.dir}/standalone
app.server.wildfly.jdk.java.options=${app.server.jdk.java.options} --add-opens=java.base/java.util=ALL-UNNAMED
app.server.wildfly.jvm.mem=${app.server.jvm.mem}
app.server.wildfly.jvm.args=${app.server.jvm.args} -Djboss.as.management.blocking.timeout=1800
app.server.wildfly.lib.global.dir=${app.server.wildfly.dir}/modules/com/liferay/portal/main
Expand Down
39 changes: 30 additions & 9 deletions build-dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
>
<replacefilter
token="-Xquickstart -Dfile.encoding=UTF-8 -Duser.timezone=GMT"
value="${app.server.websphere.jvm.args} -Xquickstart ${app.server.websphere.jvm.mem}"
value="${app.server.websphere.jdk.java.options} ${app.server.websphere.jvm.args} -Xquickstart ${app.server.websphere.jvm.mem}"
/>
</replace>
</sequential>
Expand Down Expand Up @@ -378,6 +378,7 @@ closeTemplate()
<![CDATA[
#!/bin/sh
export JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS ${app.server.weblogic.jdk.java.options}"
export MW_HOME="${app.server.weblogic.dir}"
export USER_MEM_ARGS="${app.server.weblogic.jvm.mem}"
export WL_HOME="${app.server.weblogic.wlserver.dir}"
Expand Down Expand Up @@ -510,7 +511,7 @@ release was successful.</echo>
<target name="generate-tomcat-setenv">
<echo file="tools/servers/tomcat/bin/setenv.sh">CATALINA_OPTS="$CATALINA_OPTS ${app.server.tomcat.jvm.args} ${app.server.tomcat.jvm.mem}"

JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=jdk.zipfs/jdk.nio.zipfs=ALL-UNNAMED"</echo>
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS ${app.server.tomcat.jdk.java.options}"</echo>

<chmod
file="tools/servers/tomcat/bin/setenv.sh"
Expand All @@ -519,7 +520,7 @@ JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.lang=ALL-UNNAMED

<echo file="tools/servers/tomcat/bin/setenv.bat">set "CATALINA_OPTS=%CATALINA_OPTS% ${app.server.tomcat.jvm.args} ${app.server.tomcat.jvm.mem}"

set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=jdk.zipfs/jdk.nio.zipfs=ALL-UNNAMED"</echo>
set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% ${app.server.tomcat.jdk.java.options}"</echo>
</target>

<target name="install-weblogic14-setup-files">
Expand Down Expand Up @@ -945,7 +946,10 @@ this task.
</replace>

<echo append="true" file="${app.server.jboss.bin.dir}/standalone.conf">
<![CDATA[${line.separator}JAVA_OPTS="$JAVA_OPTS ${app.server.jboss.jvm.args} ${app.server.jboss.jvm.mem}"]]>
<![CDATA[${line.separator}JAVA_OPTS="$JAVA_OPTS ${app.server.jboss.jvm.args} ${app.server.jboss.jvm.mem}"
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS ${app.server.jboss.jdk.java.options}"
export JDK_JAVA_OPTIONS]]>
</echo>

<replace
Expand Down Expand Up @@ -1038,15 +1042,20 @@ this task.
file="${app.server.tcserver.bin.dir}/setenv.bat"
>
<replacetoken><![CDATA[set JVM_OPTS=-Xmx512M -Xss256K]]></replacetoken>
<replacevalue expandProperties="true"><![CDATA[set JVM_OPTS=${app.server.tcserver.jvm.args} ${app.server.tcserver.jvm.mem}]]></replacevalue>
<replacevalue expandProperties="true"><![CDATA[set JVM_OPTS=${app.server.tcserver.jvm.args} ${app.server.tcserver.jvm.mem}
set JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% ${app.server.tcserver.jdk.java.options}]]></replacevalue>
</replace>
</then>
<else>
<replace
file="${app.server.tcserver.bin.dir}/setenv.sh"
>
<replacetoken><![CDATA[JVM_OPTS="-Xmx512M -Xss256K"]]></replacetoken>
<replacevalue expandProperties="true"><![CDATA[JVM_OPTS="${app.server.tcserver.jvm.args} ${app.server.tcserver.jvm.mem}"]]></replacevalue>
<replacevalue expandProperties="true"><![CDATA[JVM_OPTS="${app.server.tcserver.jvm.args} ${app.server.tcserver.jvm.mem}"
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS ${app.server.tcserver.jdk.java.options}"
export JDK_JAVA_OPTIONS]]></replacevalue>
</replace>
</else>
</if>
Expand Down Expand Up @@ -1369,6 +1378,7 @@ closeTemplate()
<echo file="${tstamp.value}/create-weblogic-domain.bat">
@echo off

set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% ${app.server.weblogic.jdk.java.options}"
set "MW_HOME=${app.server.weblogic.dir.windows}"
set "USER_MEM_ARGS=${app.server.weblogic.jvm.mem}"
set "WL_HOME=${app.server.weblogic.wlserver.dir.windows}"
Expand All @@ -1391,6 +1401,7 @@ closeTemplate()
<echo file="${tstamp.value}/create-weblogic-domain.bat">
@echo off

set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% ${app.server.weblogic.jdk.java.options}"
set "MW_HOME=${app.server.weblogic.dir.windows}"
set "USER_MEM_ARGS=${app.server.weblogic.jvm.mem}"
set "WL_HOME=${app.server.weblogic.wlserver.dir.windows}"
Expand Down Expand Up @@ -1419,6 +1430,7 @@ closeTemplate()
set DERBY_FLAG="false"
set "JAVA_OPTIONS=%JAVA_OPTIONS% ${app.server.weblogic.jvm.args} -da:org.apache.lucene... -da:org.aspectj..."
set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% ${app.server.weblogic.jdk.java.options}"
set "MW_HOME=${app.server.weblogic.dir.windows}"
set "USER_MEM_ARGS=${app.server.weblogic.jvm.mem}"
]]>
Expand Down Expand Up @@ -1561,6 +1573,7 @@ closeTemplate()
<echo file="${tstamp.value}/create-weblogic-domain.sh">
#!/bin/sh

export JDK_JAVA_OPTIONS="%JDK_JAVA_OPTIONS ${app.server.weblogic.jdk.java.options}"
export MW_HOME="${app.server.weblogic.dir}"
export USER_MEM_ARGS="${app.server.weblogic.jvm.mem}"
export WL_HOME="${app.server.weblogic.wlserver.dir}"
Expand All @@ -1576,6 +1589,7 @@ closeTemplate()
<echo file="${tstamp.value}/create-weblogic-domain.sh">
#!/bin/sh

export JDK_JAVA_OPTIONS="%JDK_JAVA_OPTIONS ${app.server.weblogic.jdk.java.options}"
export MW_HOME="${app.server.weblogic.dir}"
export USER_MEM_ARGS="${app.server.weblogic.jvm.mem}"
export WL_HOME="${app.server.weblogic.wlserver.dir}"
Expand Down Expand Up @@ -1607,6 +1621,7 @@ closeTemplate()
# Any changes to this script may be lost when adding extensions to this configuration.
export DERBY_FLAG="false"
export JDK_JAVA_OPTIONS="%JDK_JAVA_OPTIONS ${app.server.weblogic.jdk.java.options}"
export JAVA_OPTIONS="${JAVA_OPTIONS} ${app.server.weblogic.jvm.args} -da:org.apache.lucene... -da:org.aspectj... "
export MW_HOME="${app.server.weblogic.dir}"
export USER_MEM_ARGS="${app.server.weblogic.jvm.mem}"
Expand Down Expand Up @@ -1701,7 +1716,7 @@ closeTemplate()
file="${app.server.weblogic.instance.dir}/startWebLogic.sh"
>
<replacetoken><![CDATA[-Xmx1024m]]></replacetoken>
<replacevalue expandProperties="true"><![CDATA[${app.server.weblogic.jvm.args} ${app.server.weblogic.jvm.mem}]]></replacevalue>
<replacevalue expandProperties="true"><![CDATA[${app.server.weblogic.jdk.java.options} ${app.server.weblogic.jvm.args} ${app.server.weblogic.jvm.mem}]]></replacevalue>
</replace>

<chmod
Expand Down Expand Up @@ -1788,6 +1803,7 @@ closeTemplate()
<![CDATA[
# Any changes to this script may be lost when adding extensions to this configuration.
export DERBY_FLAG="false"
export JDK_JAVA_OPTIONS="%JDK_JAVA_OPTIONS ${app.server.weblogic.jdk.java.options}"
export JAVA_OPTIONS="${JAVA_OPTIONS} ${app.server.weblogic.jvm.args} -da:org.apache.lucene... -da:org.aspectj... "
export MW_HOME="${app.server.weblogic.dir}"
export USER_MEM_ARGS="${app.server.weblogic.jvm.mem}"
Expand Down Expand Up @@ -2612,7 +2628,10 @@ this task.
</replace>

<echo append="true" file="${app.server.wildfly.bin.dir}/standalone.conf">
<![CDATA[${line.separator}JAVA_OPTS="$JAVA_OPTS ${app.server.wildfly.jvm.args} ${app.server.wildfly.jvm.mem}"]]>
<![CDATA[${line.separator}JAVA_OPTS="$JAVA_OPTS ${app.server.wildfly.jvm.args} ${app.server.wildfly.jvm.mem}"
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS ${app.server.wildfly.jdk.java.options}"
export JDK_JAVA_OPTIONS]]>
</echo>

<replace
Expand All @@ -2627,7 +2646,9 @@ this task.
>
<replacetoken><![CDATA[:JAVA_OPTS_SET]]></replacetoken>
<replacevalue expandProperties="true">
<![CDATA[set "JAVA_OPTS=%JAVA_OPTS% ${app.server.wildfly.jvm.args} ${app.server.wildfly.jvm.mem}":JAVA_OPTS_SET]]>
<![CDATA[set "JAVA_OPTS=%JAVA_OPTS% ${app.server.wildfly.jvm.args} ${app.server.wildfly.jvm.mem}"
set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% ${app.server.wildfly.jdk.java.options}":JAVA_OPTS_SET]]>
</replacevalue>
</replace>

Expand Down

0 comments on commit 4ce3a8f

Please sign in to comment.