mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 12:32:15 +00:00
[FIXED JENKINS-19976] Enable plugins to load classes from optionally depending plugins even without restarting after depended ones installed.
This commit is contained in:
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");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user