Skip to content

Commit

Permalink
[JENKINS-42310] CleanupWorkspace Lint defect support Maven and Matrix…
Browse files Browse the repository at this point in the history
… projects
  • Loading branch information
v1v committed Feb 24, 2017
1 parent 8aca943 commit eaca2a7
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -2,7 +2,7 @@

import hudson.model.Descriptor;
import hudson.model.Item;
import hudson.model.Project;
import hudson.model.AbstractProject;
import jenkins.model.Jenkins;
import org.jenkins.ci.plugins.jenkinslint.model.AbstractCheck;

Expand All @@ -19,7 +19,8 @@ public CleanupWorkspaceChecker() {

public boolean executeCheck(Item item) {
if (Jenkins.getInstance().pluginManager.getPlugin("ws-cleanup")!=null) {
return item instanceof Project && ((Project) item).getPublisher(Descriptor.find("hudson.plugins.ws_cleanup.WsCleanup")) == null;
return item instanceof AbstractProject &&
((AbstractProject) item).getPublishersList().get(Descriptor.find("hudson.plugins.ws_cleanup.WsCleanup")) == null;
} else {
return true;
}
Expand Down

0 comments on commit eaca2a7

Please sign in to comment.