diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2018-07-05 11:51:17 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-09-19 10:54:37 +0200 |
commit | fdf0f2f89300342c932ab23b71c895866c7d4834 (patch) | |
tree | 2a8be2a4e5bf3d39e59efbef7ceefa192ee76711 /server | |
parent | 4013c04fad08403ec9feaa406eb69f2e9dc6d745 (diff) | |
download | sonarqube-fdf0f2f89300342c932ab23b71c895866c7d4834.tar.gz sonarqube-fdf0f2f89300342c932ab23b71c895866c7d4834.zip |
SONAR-10541, SONAR-10331 Drop compatibility mode and clean plugin classloader
Diffstat (limited to 'server')
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 bc7a95804b5..81fe42adca6 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 19d0f661aa4..15111dfb774 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') |