public Map<String,String> parameters = new HashMap<String, String>();
protected int run() throws Exception {
job.checkPermission(Item.BUILD);
ParametersAction a = null;
if (!parameters.isEmpty()) {
ParametersDefinitionProperty pdp = job.getProperty(ParametersDefinitionProperty.class);
if (pdp==null)
throw new AbortException(job.getFullDisplayName()+" is not parameterized but the -p option was specified");
List<ParameterValue> values = new ArrayList<ParameterValue>();
for (Entry<String, String> e : parameters.entrySet()) {
String name = e.getKey();
ParameterDefinition pd = pdp.getParameterDefinition(name);
if (pd==null)
throw new AbortException(String.format("\'%s\' is not a valid parameter. Did you mean %s?",
name, EditDistance.findNearest(name, pdp.getParameterDefinitionNames())));
values.add(pd.createValue(this,e.getValue()));
}
for (ParameterDefinition pd : pdp.getParameterDefinitions()) {
if (parameters.get(pd.getName()) == null) {
values.add(pd.getDefaultParameterValue());
}
}
a = new ParametersAction(values);
}
Future<? extends AbstractBuild> f = job.scheduleBuild2(0, new CLICause(), a);
if (!sync) return 0;