Having troubles with a BuildWrapper: It does not become active for any job.
I'm building against 1.438.
The plugin has also a Builder which works fine.
I had BuildWrappers working before (in a different context).
I thought there's no extra "activation" necessary.
Looked into the BuildWrappers of several other plugins, but can't see what I
might be missing.
Thanks!
-Max
package org.example;
import hudson.Extension;
import hudson.Launcher;
import hudson.model.BuildListener;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.tasks.BuildWrapper;
import hudson.tasks.BuildWrapperDescriptor;
import java.io.IOException;
public class MyBuildWrapper extends BuildWrapper{
@Override
public Environment setUp(AbstractBuild build, Launcher launcher,
BuildListener listener) throws IOException, InterruptedException {
System.out.println("MyBuildWrapper.setUp "+build.getDisplayName());
return new Environment(){
@Override
public boolean tearDown(AbstractBuild build, BuildListener listener)
throws IOException, InterruptedException {
System.out.println("MyBuildWrapper.tearDown "+build.getDisplayName());
return true;
}
};
}
@Extension
public static final class DescriptorImpl extends BuildWrapperDescriptor {
@Override
public String getDisplayName() {
return "My Build Wrapper";
}
@Override
public boolean isApplicable(AbstractProject item) {
return true;
}
}
}