[FIXED JENKINS-19976] Enable plugins to load classes from optionally depending plugins even without restarting after depended ones installed.

This commit is contained in:
ikedam committed 2013-12-10 23:53:38 +09:00
1 parent c0d67f5ec0
commit 87e2a7e8d5
3 files changed
+69

No files matched your search

@@ -450,6 +450,23 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
} catch (ReactorException e) {
throw new IOException("Failed to initialize "+ sn +" plugin",e);
}
// recalculate dependencies of plugins optionally depending the newly deployed one.
for (PluginWrapper depender: plugins) {
if (depender.equals(p)) {
// skip itself.
continue;
}
for (Dependency d: depender.getOptionalDependencies()) {
if (d.shortName.equals(p.getShortName())) {
// this plugin depends on the newly loaded one!
// recalculate dependencies!
getPluginStrategy().updateDependency(depender, p);
break;
}
}
}
LOGGER.info("Plugin " + sn + " dynamically installed");
}