JarPluginProvider: Add JarScanner on running plugin JAR file

The JarScanner is being added on the source JAR file.  This causes
the file to be held open, which prevents the file from being renamed
when the plugin is disabled when running Gerrit on Windows.

Add the JarScanner on the copied JAR file from which the plugin is
actually being run instead.

Bug: Issue 3310
Change-Id: I14abda9bcaaf002e74e728a53f3efd60186df096
This commit is contained in:
David Pursehouse
2015-05-11 14:48:36 +09:00
parent b11fb75605
commit 43a7525769

View File

@@ -142,7 +142,7 @@ public class JarPluginProvider implements ServerPluginProvider {
new URLClassLoader(urls.toArray(new URL[urls.size()]),
PluginLoader.parentFor(type));
JarScanner jarScanner = createJarScanner(srcJar);
JarScanner jarScanner = createJarScanner(tmp);
ServerPlugin plugin =
new ServerPlugin(name, description.canonicalUrl, description.user,
srcJar, snapshot, jarScanner, description.dataDir,