From: Simon Brandhof Date: Wed, 8 Oct 2014 11:33:35 +0000 (+0200) Subject: SONAR-5710 Some JVM options should not be configurable X-Git-Tag: 4.5.1-RC1~64 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7eb13c86cafb14b8d7afbb3737a27fb3c6fe9d51;p=sonarqube.git SONAR-5710 Some JVM options should not be configurable --- diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index ff26347346f..e3477959f1b 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -66,10 +66,10 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000 # Use the following property to customize JVM options. Enabling the HotSpot Server VM # mode (-server) is recommended. # Note that the option -Dfile.encoding=UTF-8 is mandatory. -#sonar.web.javaOpts=-Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError \ -# -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false +#sonar.web.javaOpts=-Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -# Same as previous property, but allows to not repeat all settings like -Djava.awt.headless=true +# Same as previous property, but allows to not repeat all other settings +# like -Djava.awt.headless=true #sonar.web.javaAdditionalOpts= # Binding IP address. For servers with more than one IP address, this property specifies which @@ -173,10 +173,10 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000 # JVM options. Note that enabling the HotSpot Server VM mode (-server) is recommended. #sonar.search.javaOpts=-Xmx256m -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true \ # -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 \ -# -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError \ -# -Djava.awt.headless=true +# -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -# Same as previous property, but allows to not repeat all settings like -Djava.awt.headless=true +# Same as previous property, but allows to not repeat all other settings +# like -Djava.awt.headless=true #sonar.search.javaAdditionalOpts= # Elasticsearch port. Default is 9001. Use 0 to get a free port. diff --git a/sonar-application/src/main/java/org/sonar/application/App.java b/sonar-application/src/main/java/org/sonar/application/App.java index ff8016fabc8..9c027abebdf 100644 --- a/sonar-application/src/main/java/org/sonar/application/App.java +++ b/sonar-application/src/main/java/org/sonar/application/App.java @@ -70,6 +70,7 @@ public class App implements Stoppable { JavaCommand elasticsearch = new JavaCommand("search"); elasticsearch .setWorkDir(homeDir) + .addJavaOptions("-Djava.awt.headless=true") .addJavaOptions(props.nonNullValue(DefaultSettings.SEARCH_JAVA_OPTS)) .addJavaOptions(props.nonNullValue(DefaultSettings.SEARCH_JAVA_ADDITIONAL_OPTS)) .setTempDir(tempDir.getAbsoluteFile()) @@ -83,6 +84,7 @@ public class App implements Stoppable { if (StringUtils.isEmpty(props.value(DefaultSettings.CLUSTER_MASTER))) { JavaCommand webServer = new JavaCommand("web") .setWorkDir(homeDir) + .addJavaOptions("-Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false") .addJavaOptions(props.nonNullValue(DefaultSettings.WEB_JAVA_OPTS)) .addJavaOptions(props.nonNullValue(DefaultSettings.WEB_JAVA_ADDITIONAL_OPTS)) .setTempDir(tempDir.getAbsoluteFile())