Skip to content

Commit

Permalink
LPD-16396 Fix test on JDK8, we need it as ci only support JDK8 now
Browse files Browse the repository at this point in the history
  • Loading branch information
tinatian authored and brianchandotcom committed Feb 7, 2024
1 parent ceb81c4 commit 1292460
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.liferay.petra.process.local.LocalProcessExecutor;
import com.liferay.portal.configuration.metatype.bnd.util.ConfigurableUtil;
import com.liferay.portal.kernel.util.HashMapBuilder;
import com.liferay.portal.kernel.util.JavaDetector;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration;
Expand Down Expand Up @@ -167,6 +168,13 @@ public Builder elasticsearchConfigurationProperties(
Map<String, Object> elasticsearchConfigurationProperties,
String clusterName) {

String sidecarJVMOptions = "-Xmx256m";

if (!JavaDetector.isJDK8()) {
sidecarJVMOptions =
"-Xmx256m|--add-opens=java.base/java.lang=ALL-UNNAMED";
}

return HashMapBuilder.<String, Object>put(
"clusterName", clusterName
).put(
Expand All @@ -178,8 +186,7 @@ public Builder elasticsearchConfigurationProperties(
).put(
"sidecarHttpPort", HttpPortRange.AUTO
).put(
"sidecarJVMOptions",
"-Xmx256m|--add-opens=java.base/java.lang=ALL-UNNAMED"
"sidecarJVMOptions", sidecarJVMOptions
).putAll(
elasticsearchConfigurationProperties
).build();
Expand Down

0 comments on commit 1292460

Please sign in to comment.