]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5710 Some JVM options should not be configurable
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 8 Oct 2014 11:33:35 +0000 (13:33 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 8 Oct 2014 11:33:35 +0000 (13:33 +0200)
sonar-application/src/main/assembly/conf/sonar.properties
sonar-application/src/main/java/org/sonar/application/App.java

index ff26347346f94e433b465ec80022beca4a8cf35c..e3477959f1b2cc33c95ec061c52d9763852ff902 100644 (file)
@@ -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.
index ff8016fabc8d7a92b8d6ff23bd0084d840004230..9c027abebdf7c76008be6826534f933c6ded2f98 100644 (file)
@@ -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())