aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application/src/main
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@sonarsource.com>2014-10-08 14:01:17 +0200
committerStephane Gamard <stephane.gamard@sonarsource.com>2014-10-08 14:01:17 +0200
commitd5d20d0f777ba89b49575846c8f96afd316829f4 (patch)
tree257a0341add4bf8a00a20af45e623a548b357255 /sonar-application/src/main
parent0a890a7a3069e79bc1029f17ddc59c8fb4409274 (diff)
parent7eb13c86cafb14b8d7afbb3737a27fb3c6fe9d51 (diff)
downloadsonarqube-d5d20d0f777ba89b49575846c8f96afd316829f4.tar.gz
sonarqube-d5d20d0f777ba89b49575846c8f96afd316829f4.zip
Merge remote-tracking branch 'origin/branch-4.5'
Conflicts: server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndex.java sonar-batch/src/main/java/org/sonar/batch/scan2/DefaultFileLinesContextFactory.java
Diffstat (limited to 'sonar-application/src/main')
-rw-r--r--sonar-application/src/main/assembly/conf/sonar.properties14
-rw-r--r--sonar-application/src/main/java/org/sonar/application/App.java6
-rw-r--r--sonar-application/src/main/java/org/sonar/application/DefaultSettings.java4
3 files changed, 19 insertions, 5 deletions
diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties
index 3fa9963d19a..b9bee4266e5 100644
--- a/sonar-application/src/main/assembly/conf/sonar.properties
+++ b/sonar-application/src/main/assembly/conf/sonar.properties
@@ -66,8 +66,11 @@ 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 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
# address will be used for listening on the specified ports.
@@ -170,8 +173,11 @@ 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 other settings
+# like -Djava.awt.headless=true
+#sonar.search.javaAdditionalOpts=
# Elasticsearch port. Default is 9001. Use 0 to get a free port.
# This port must be private and must not be exposed to the Internet.
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 502cf561394..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,7 +70,9 @@ public class App implements Stoppable {
JavaCommand elasticsearch = new JavaCommand("search");
elasticsearch
.setWorkDir(homeDir)
- .addJavaOptions(props.value(DefaultSettings.SEARCH_JAVA_OPTS))
+ .addJavaOptions("-Djava.awt.headless=true")
+ .addJavaOptions(props.nonNullValue(DefaultSettings.SEARCH_JAVA_OPTS))
+ .addJavaOptions(props.nonNullValue(DefaultSettings.SEARCH_JAVA_ADDITIONAL_OPTS))
.setTempDir(tempDir.getAbsoluteFile())
.setClassName("org.sonar.search.SearchServer")
.setArguments(props.rawProperties())
@@ -82,7 +84,9 @@ 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())
// required for logback tomcat valve
.setEnvVariable("sonar.path.logs", props.nonNullValue("sonar.path.logs"))
diff --git a/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java b/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java
index 701249f5f63..4a936789499 100644
--- a/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java
+++ b/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java
@@ -36,7 +36,9 @@ class DefaultSettings {
static final String CLUSTER_NODE_NAME = "sonar.node.name";
static final String SEARCH_PORT = "sonar.search.port";
static final String SEARCH_JAVA_OPTS = "sonar.search.javaOpts";
+ static final String SEARCH_JAVA_ADDITIONAL_OPTS = "sonar.search.javaAdditionalOpts";
static final String WEB_JAVA_OPTS = "sonar.web.javaOpts";
+ static final String WEB_JAVA_ADDITIONAL_OPTS = "sonar.web.javaAdditionalOpts";
static final String JDBC_URL = "sonar.jdbc.url";
static final String JDBC_LOGIN = "sonar.jdbc.username";
static final String JDBC_PASSWORD = "sonar.jdbc.password";
@@ -70,9 +72,11 @@ class DefaultSettings {
defaults.put(SEARCH_JAVA_OPTS, "-Xmx256m -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true " +
"-XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly " +
"-XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true");
+ defaults.put(SEARCH_JAVA_ADDITIONAL_OPTS, "");
defaults.put(CLUSTER_NODE_NAME, "sonar-" + System.currentTimeMillis());
defaults.put(WEB_JAVA_OPTS, "-Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true " +
"-Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false");
+ defaults.put(WEB_JAVA_ADDITIONAL_OPTS, "");
defaults.put(JDBC_URL, "jdbc:h2:tcp://localhost:9092/sonar");
defaults.put(JDBC_LOGIN, "sonar");
defaults.put(JDBC_PASSWORD, "sonar");