aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2018-07-05 11:51:17 +0200
committerSonarTech <sonartech@sonarsource.com>2018-07-17 20:21:27 +0200
commit8cfc544c1fb69e783c58d74ad3083a686c25f07a (patch)
tree141f98fc11a18e92e09a97233cc2a1620fcda0b0 /server
parent8bbe57990ec82e2419925b13b90a1e0869d09512 (diff)
downloadsonarqube-8cfc544c1fb69e783c58d74ad3083a686c25f07a.tar.gz
sonarqube-8cfc544c1fb69e783c58d74ad3083a686c25f07a.zip
SONAR-10541, SONAR-10331 Drop compatibility mode and clean plugin classloader
Diffstat (limited to 'server')
-rw-r--r--server/sonar-ce-task-projectanalysis/build.gradle3
-rw-r--r--server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java2
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/platform/ServerFileSystemImpl.java16
-rw-r--r--server/sonar-server/build.gradle6
4 files changed, 19 insertions, 8 deletions
diff --git a/server/sonar-ce-task-projectanalysis/build.gradle b/server/sonar-ce-task-projectanalysis/build.gradle
index 8b52c4232f2..b73d4b2e72b 100644
--- a/server/sonar-ce-task-projectanalysis/build.gradle
+++ b/server/sonar-ce-task-projectanalysis/build.gradle
@@ -42,7 +42,8 @@ dependencies {
compileOnly project(':server:sonar-db-dao')
compileOnly project(':server:sonar-process')
compileOnly project(':server:sonar-server-common')
- compileOnly project(path: ':sonar-plugin-api')
+ compileOnly project(':sonar-plugin-api')
+ compileOnly project(':sonar-duplications')
testCompile 'com.google.code.findbugs:jsr305'
testCompile 'com.h2database:h2'
diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
index 0ed29601675..4cea397abf1 100644
--- a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
+++ b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
@@ -150,7 +150,9 @@ public class ComputeEngineContainerImplTest {
Properties properties = ProcessProperties.defaults();
File homeDir = tempFolder.newFolder();
File dataDir = new File(homeDir, "data");
+ dataDir.mkdirs();
File tmpDir = new File(homeDir, "tmp");
+ tmpDir.mkdirs();
properties.setProperty(PATH_HOME.getKey(), homeDir.getAbsolutePath());
properties.setProperty(PATH_DATA.getKey(), dataDir.getAbsolutePath());
properties.setProperty(PATH_TEMP.getKey(), tmpDir.getAbsolutePath());
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/platform/ServerFileSystemImpl.java b/server/sonar-server-common/src/main/java/org/sonar/server/platform/ServerFileSystemImpl.java
index 9818d98584f..d596044e8e3 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/platform/ServerFileSystemImpl.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/platform/ServerFileSystemImpl.java
@@ -20,6 +20,8 @@
package org.sonar.server.platform;
import java.io.File;
+import java.io.IOException;
+import org.apache.commons.io.FileUtils;
import org.picocontainer.Startable;
import org.sonar.api.config.Configuration;
import org.sonar.api.utils.log.Logger;
@@ -39,9 +41,9 @@ public class ServerFileSystemImpl implements ServerFileSystem, org.sonar.api.pla
private final File uninstallDir;
public ServerFileSystemImpl(Configuration config) {
- this.homeDir = new File(config.get(PATH_HOME.getKey()).get());
- this.tempDir = new File(config.get(PATH_TEMP.getKey()).get());
- File dataDir = new File(config.get(PATH_DATA.getKey()).get());
+ this.homeDir = createDir(new File(config.get(PATH_HOME.getKey()).get()));
+ this.tempDir = createDir(new File(config.get(PATH_TEMP.getKey()).get()));
+ File dataDir = createDir(new File(config.get(PATH_DATA.getKey()).get()));
this.deployDir = new File(dataDir, "web/deploy");
this.uninstallDir = new File(getTempDir(), "uninstalled-plugins");
}
@@ -91,4 +93,12 @@ public class ServerFileSystemImpl implements ServerFileSystem, org.sonar.api.pla
return uninstallDir;
}
+ private static File createDir(File dir) {
+ try {
+ FileUtils.forceMkdir(dir);
+ return dir;
+ } catch (IOException e) {
+ throw new IllegalStateException("Fail to create directory " + dir, e);
+ }
+ }
}
diff --git a/server/sonar-server/build.gradle b/server/sonar-server/build.gradle
index 1efcb4d3026..e5f7979f20b 100644
--- a/server/sonar-server/build.gradle
+++ b/server/sonar-server/build.gradle
@@ -55,10 +55,8 @@ dependencies {
compile project(':server:sonar-server-common')
compile project(':sonar-core')
compile project(':sonar-scanner-protocol')
- compile(project(':sonar-markdown')) {
- // already shaded with sonar-plugin-api
- exclude group: 'org.codehaus.sonar', module: 'sonar-channel'
- }
+ compile project(':sonar-markdown')
+ compile project(':sonar-duplications')
runtime project(path: ':sonar-plugin-api', configuration: 'shadow')
compileOnly project(path: ':sonar-plugin-api')
compile project(':sonar-ws')