GStatsPublisherDescriptor

public class GStatsPublisherDescriptor extends BuildStepDescriptor<Publisher>
{
  @Override
  public boolean configure(final StaplerRequest req, final JSONObject formData)
  {
    antScript = formData.getString("antScript");
    save();
    return true;
  } // configure

  public FormValidation doCheckAntScript(@QueryParameter String value) 
  { 
    return Validate.isFile(value, "GStats");
  } // doCheckAntScript    

  @Override
  public GStatsPublisher newInstance(final StaplerRequest req, final JSONObject formData) throws FormException
  {
    return new GStatsPublisher();
  } // newInstance

  public boolean isApplicable(Class<? extends AbstractProject> jobType)
  {
    return DeployProject.class.isAssignableFrom(jobType);
  } // isApplicable  
} // class GStatsPublisherDescriptor
    
Here's the descriptor. GStats requires some configuration - the Ant script it invokes. This is a system wide parameter, so we set that on the descriptor - like we did with the English/French thing on the Hello world example. Under src/resources/plc/gstats/GStatsPublisher/global.xml these a little scrap of jelly that hooks up to the configure method. These are picked up and displayed on the configure Jenkins page.