Merge branch 'master' of github.com:jenkinsci/jenkins

Conflicts:
	changelog.html
This commit is contained in:
Kohsuke Kawaguchi committed 2016-05-11 11:46:30 -07:00
commit 75e93bed8a
48 files changed
+920 -84

No files matched your search

+8 -3
View File
@@ -28,6 +28,7 @@ import com.google.common.collect.ImmutableSet;
import hudson.PluginManager.PluginInstanceStore;
import hudson.model.Api;
import hudson.model.ModelObject;
import jenkins.MissingDependencyException;
import jenkins.YesNoMaybe;
import jenkins.model.Jenkins;
import hudson.model.UpdateCenter;
@@ -441,6 +442,10 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
* Enables this plugin next time Jenkins runs.
*/
public void enable() throws IOException {
if (!disableFile.exists()) {
LOGGER.log(Level.FINEST, "Plugin {0} has been already enabled. Skipping the enable() operation", getShortName());
return;
}
if(!disableFile.delete())
throw new IOException("Failed to delete "+disableFile);
}
@@ -514,14 +519,14 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
* thrown if one or several mandatory dependencies doesn't exists.
*/
/*package*/ void resolvePluginDependencies() throws IOException {
List<String> missingDependencies = new ArrayList<String>();
List<Dependency> missingDependencies = new ArrayList<>();
// make sure dependencies exist
for (Dependency d : dependencies) {
if (parent.getPlugin(d.shortName) == null)
missingDependencies.add(d.toString());
missingDependencies.add(d);
}
if (!missingDependencies.isEmpty())
throw new IOException("Dependency "+Util.join(missingDependencies, ", ")+" doesn't exist");
throw new MissingDependencyException(this.shortName, missingDependencies);
// add the optional dependencies that exists
for (Dependency d : optionalDependencies) {