diff --git a/core/src/main/java/hudson/PluginWrapper.java b/core/src/main/java/hudson/PluginWrapper.java index 02dfc378fd..e57ea496d3 100644 --- a/core/src/main/java/hudson/PluginWrapper.java +++ b/core/src/main/java/hudson/PluginWrapper.java @@ -174,7 +174,7 @@ public class PluginWrapper implements Comparable { * @param dependencies a list of mandatory dependencies * @param optionalDependencies a list of optional dependencies */ - public PluginWrapper(PluginManager parent, File archive, Manifest manifest, URL baseResourceURL, + public PluginWrapper(PluginManager parent, File archive, Manifest manifest, URL baseResourceURL, ClassLoader classLoader, File disableFile, List dependencies, List optionalDependencies) { this.parent = parent; @@ -187,7 +187,7 @@ public class PluginWrapper implements Comparable { this.active = !disableFile.exists(); this.dependencies = dependencies; this.optionalDependencies = optionalDependencies; - } + } /** * Returns the URL of the index page jelly script. @@ -201,7 +201,9 @@ public class PluginWrapper implements Comparable { while (en.hasMoreElements()) idx = en.nextElement(); } catch (IOException ignore) { } - return idx; + // In case plugin has dependencies but is missing its own index.jelly, + // check that result has this plugin's artifactId in it: + return idx != null && idx.toString().contains(shortName) ? idx : null; } private String computeShortName(Manifest manifest, File archive) {