If during hudson-dev:run we have updated a bundled plugin, honor that pin at next start.

This commit is contained in:
Jesse Glick committed 2014-09-22 13:03:31 -04:00
1 parent cd8c8e0072
commit be76d09384
1 file changed
+10
@@ -10,6 +10,7 @@ import java.util.Collection;
import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -49,6 +50,15 @@ public class InitStrategy {
// for example, while doing "mvn jpi:run" or "mvn hpi:run" on a plugin that's bundled with Jenkins, we want to the
// *.jpl file to override the bundled jpi/hpi file.
getBundledPluginsFromProperty(r);
Iterator<File> it = r.iterator();
while (it.hasNext()) {
File f = it.next();
if (new File(pm.rootDir, f.getName().replace(".hpi", ".jpi") + ".pinned").isFile()) {
// Cf. PluginManager.copyBundledPlugin, which is not called in this case.
LOGGER.log(Level.INFO, "ignoring {0} since this plugin is pinned", f);
it.remove();
}
}
// similarly, we prefer *.jpi over *.hpi
listPluginFiles(pm, ".jpl", r); // linked plugin. for debugging.