0

I have a forked a plugin which right now is available only in 'freestyle build or generic build'. I want the plugin to be available to maven build configuration as well but am confused as to what the extension point for that is and how to make that change. In the plugin configurator java class I see the following :

 @Override
        public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
            req.bindParameters(this, "generic");            
            //req.bindParameters(this , "maven" );
            save();
            return true;
        }

As you can see req.bindParamter right now targets 'generic' , adding maven underneath doesn't help. So what exactly is the bindParameter for and what other method should I bee looking to resolve my query ?

tim_yates
  • 167,322
  • 27
  • 342
  • 338
Scooby
  • 3,371
  • 8
  • 44
  • 84

1 Answers1

0

In your extension, check the isApplicable() method, and make sure you're always returning true.

The method typically looks something like this:

   public boolean isApplicable(Class<? extends AbstractProject> jobType) {
        return true;
    }

If you want to restrict it to run from within a certain job type (like freestyle), it'd look like:

   public boolean isApplicable(Class<? extends AbstractProject> jobType) {
        return FreeStyleProject.class.isAssignableFrom(jobType);
    }
fmanaa
  • 174
  • 2
  • 9