public class MySCM extends SCM implements Serializable {
// Global configuration options - set from the GUI
private String sometoolPath;
@DataBoundConstructor
public MySCM() {
System.out.println("Instantiated new instance of MySCM!!!");
}
@DataBoundSetter
public void setSometoolPath(String sometoolPath) {
System.out.println("Updated path: " + sometoolPath);
this.sometoolPath = sometoolPath;
}
public String getSometoolPath() {
return sometoolPath;
}
...
@Override
public DescriptorImpl getDescriptor() {
return (DescriptorImpl) super.getDescriptor();
}
@Extension
public static final class DescriptorImpl extends SCMDescriptor<MySCM> {
public DescriptorImpl() {
super(MySCM.class, null);
load();
}
@Override
public SCM newInstance(StaplerRequest req, JSONObject formData) throws FormException {
MySCM scm = (MySCM) super.newInstance(req, formData);
return scm;
}
@Override
public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
save();
return true;
}
@Override
public String getDisplayName() {
return "My Cool SCM";
}
}
}