[JENKINS-34683] Do not print stack trace if plugin is missing dependencies (#2048)

[JENKINS-34683] - Do not print stack trace if plugin is missing dependencies
This commit is contained in:
Carlos Sanchez authored and Oleg Nenashev committed 2016-05-09 16:34:26 +02:00
1 parent f4765d9aec
commit 3e1bc969f4
4 files changed
+76 -3

No files matched your search

@@ -48,6 +48,7 @@ import hudson.util.VersionNumber;
import hudson.util.XStream2;
import jenkins.ClassLoaderReflectionToolkit;
import jenkins.InitReactorRunner;
import jenkins.MissingDependencyException;
import jenkins.RestartRequiredException;
import jenkins.YesNoMaybe;
import jenkins.install.InstallState;
@@ -413,6 +414,12 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
try {
p.resolvePluginDependencies();
strategy.load(p);
} catch (MissingDependencyException e) {
failedPlugins.add(new FailedPlugin(p.getShortName(), e));
activePlugins.remove(p);
plugins.remove(p);
LOGGER.log(Level.SEVERE, "Failed to install {0}: {1}", new Object[] { p.getShortName(), e.getMessage() });
return;
} catch (IOException e) {
failedPlugins.add(new FailedPlugin(p.getShortName(), e));
activePlugins.remove(p);