mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-03 15:15:54 +00:00
[JENKINS-57528] - Load detached plugins which are implicit deps of other plugins at startup even w/o UC (#4000)
* Do not warn repeatedly of the same missing update site dependency. This happens when locally testing split plugins (despite their presence in WEB-INF/detached-plugins/*.hpi). (cherry picked from commit918a0fd221) * Detached plugins must be kept up to date with security advisories. (cherry picked from commite08d28a698) * Load detached plugins which are implicit dependencies of other plugins at startup, even if the update center was not used. (cherry picked from commitad7a36001d) * Adjusted expected version aftere08d28a698. (cherry picked from commit84f939cebd) *e08d28a698exposed tests which had been incorrectly storing plugins as *.hpi rather than *.jpi. (cherry picked from commita0abad7ec4) * Test failure afterad7a36001d. (cherry picked from commit0084e8dbdd) * Another test failure after ad7a36001d30a6174b25e616fc3c215dd24919d1; fewer installDetachedPlugin calls are now required. (cherry picked from commitb65bb54e99)
This commit is contained in:
1 parent
c7090f8d79
commit
855ea2eea2
16 files changed
+64
-18
No files matched your search
@@ -600,6 +600,25 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
}});
|
||||
}
|
||||
|
||||
void considerDetachedPlugin(String shortName) {
|
||||
if (new File(rootDir, shortName + ".jpi").isFile()) {
|
||||
LOGGER.fine(() -> "not considering loading a detached dependency " + shortName + " as it is already on disk");
|
||||
return;
|
||||
}
|
||||
LOGGER.fine(() -> "considering loading a detached dependency " + shortName);
|
||||
for (String loadedFile : loadPluginsFromWar("/WEB-INF/detached-plugins", (dir, name) -> normalisePluginName(name).equals(shortName))) {
|
||||
String loaded = normalisePluginName(loadedFile);
|
||||
File arc = new File(rootDir, loaded + ".jpi");
|
||||
LOGGER.info(() -> "Loading a detached plugin as a dependency: " + arc);
|
||||
try {
|
||||
plugins.add(strategy.createPluginWrapper(arc));
|
||||
} catch (IOException e) {
|
||||
failedPlugins.add(new FailedPlugin(arc.getName(), e));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected @Nonnull Set<String> loadPluginsFromWar(@Nonnull String fromPath) {
|
||||
return loadPluginsFromWar(fromPath, null);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user