]> source.dussan.org Git - sonarqube.git/commitdiff
Cut dependency between sonar-core and sonar-home
authorJulien HENRY <julien.henry@sonarsource.com>
Tue, 19 Jan 2016 08:50:15 +0000 (09:50 +0100)
committerJulien HENRY <julien.henry@sonarsource.com>
Tue, 19 Jan 2016 13:45:01 +0000 (14:45 +0100)
sonar-core/pom.xml
sonar-core/src/main/java/org/sonar/core/platform/RemotePlugin.java

index 4a7ae54ef7773eb71537a19ddcdaeafe78e9ed16..7738b4d2a93fe4d02f92cce5361f77a1e6938633 100644 (file)
       <groupId>org.codehaus.sonar</groupId>
       <artifactId>sonar-update-center-common</artifactId>
     </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>sonar-home</artifactId>
-    </dependency>
 
     <!-- logging -->
     <dependency>
index 65e9d683cb50117dc00d5c33ec7bd230ae0e854a..d7e24418de4829d3a0b55d8b7cb5f76161d2cbea 100644 (file)
 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() {