Skip to content
Permalink
Browse files

[JENKINS-21486] Fix :ant from daniel and separate failed plugin from

missing
  • Loading branch information...
Vlatombe committed Jul 28, 2016
1 parent b8f26b3 commit 99fa5f7a49ae06063c5306de877e1d5af3a56464
Showing with 18 additions and 5 deletions.
  1. +17 −5 core/src/main/java/hudson/PluginWrapper.java
  2. +1 −0 core/src/main/resources/hudson/Messages.properties
@@ -58,9 +58,11 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
@@ -247,7 +249,7 @@ public Dependency(String s) {

@Override
public String toString() {
return shortName + " (" + version + ") " + (optional ? "optional" : "");
return shortName + " (" + version + ")" + (optional ? " optional" : "");
}
}

@@ -572,7 +574,13 @@ public boolean hasLicensesXml() {
for (Dependency d : dependencies) {
PluginWrapper dependency = parent.getPlugin(d.shortName);
if (dependency == null) {
dependencyErrors.add(Messages.PluginWrapper_missing(d.shortName, d.version));
PluginWrapper failedDependency = NOTICE.getPlugin(d.shortName);
if (failedDependency != null) {
dependencyErrors.add(Messages.PluginWrapper_failed_to_load(failedDependency.getLongName(), d.version));
break;
} else {
dependencyErrors.add(Messages.PluginWrapper_missing(d.shortName, d.version));
}
} else {
if (dependency.isActive()) {
if (isDependencyObsolete(d, dependency)) {
@@ -730,18 +738,22 @@ public boolean isPinningForcingOldVersion() {
* Administrative Monitor for failed plugins
*/
public static final class PluginWrapperAdministrativeMonitor extends AdministrativeMonitor {
private final Set<PluginWrapper> plugins = new HashSet<>();
private final Map<String, PluginWrapper> plugins = new HashMap<>();

void addPlugin(PluginWrapper plugin) {
plugins.add(plugin);
plugins.put(plugin.shortName, plugin);
}

public boolean isActivated() {
return !plugins.isEmpty();
}

public Collection<PluginWrapper> getPlugins() {
return plugins;
return plugins.values();
}

public PluginWrapper getPlugin(String shortName) {
return plugins.get(shortName);
}

/**
@@ -74,6 +74,7 @@ ProxyConfiguration.Success=Success
Functions.NoExceptionDetails=No Exception details

PluginWrapper.missing=Plugin "{0}" ({1}) is missing. To fix, install version {1} or later.
PluginWrapper.failed_to_load=Plugin "{0}" ({1}) failed to load. Fix this plugin first.
PluginWrapper.disabledAndObsolete=Plugin "{0}" ({1}) is disabled and older than required. To fix, install version {2} or later and enable it.
PluginWrapper.disabled=Plugin "{0}" is disabled. To fix, enable it.
PluginWrapper.obsolete=Plugin "{0}" ({1}) is older than required. To fix, install version {2} or later.

0 comments on commit 99fa5f7

Please sign in to comment.
You can’t perform that action at this time.