From: Julien HENRY Date: Tue, 19 Jan 2016 08:50:15 +0000 (+0100) Subject: Cut dependency between sonar-core and sonar-home X-Git-Tag: 5.4-M9~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=01b0ee18572b75b76f45d4b8207dc77af6ae1cab;p=sonarqube.git Cut dependency between sonar-core and sonar-home --- diff --git a/sonar-core/pom.xml b/sonar-core/pom.xml index 4a7ae54ef77..7738b4d2a93 100644 --- a/sonar-core/pom.xml +++ b/sonar-core/pom.xml @@ -43,10 +43,6 @@ org.codehaus.sonar sonar-update-center-common - - ${project.groupId} - sonar-home - diff --git a/sonar-core/src/main/java/org/sonar/core/platform/RemotePlugin.java b/sonar-core/src/main/java/org/sonar/core/platform/RemotePlugin.java index 65e9d683cb5..d7e24418de4 100644 --- a/sonar-core/src/main/java/org/sonar/core/platform/RemotePlugin.java +++ b/sonar-core/src/main/java/org/sonar/core/platform/RemotePlugin.java @@ -20,8 +20,10 @@ package org.sonar.core.platform; import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang.StringUtils; -import org.sonar.home.cache.FileHashes; public class RemotePlugin { private String pluginKey; @@ -64,7 +66,11 @@ public class RemotePlugin { } public RemotePlugin setFile(File f) { - return this.setFile(f.getName(), new FileHashes().of(f)); + try (FileInputStream fis = new FileInputStream(f)) { + return this.setFile(f.getName(), DigestUtils.md5Hex(fis)); + } catch (IOException e) { + throw new IllegalStateException("Fail to compute hash", e); + } } public RemotePluginFile file() {