I have implemented a custom step extending SCMStep. The step's constructor
takes one non primitive type as an argument.
public class A {
@DataBoundConstructor
public A( String arg1, String arg2) {
}
}
@Extension
public class MyStep{
@DataBoundConstructor
public MyStep(A arg) {
}
public static class MyStepDescriptor extends SCMStepDescriptor {
@Override
public String getFunctionName() {
return "mystep";
}
}
}
I have added a config.jelly file for MyStep. When using the snippet
generator for this step, I get the following groovy
mystep([arg1:"", arg2:""])
When running the workflow job with this script, the arg parameter in the
MyStep constructor is null.
I also noticed that adding another dummy argument to MyStep constructor
generates the groovy with the parameter name.
Is there any way to overcome this problem with the snippet generator
without adding a dummy parameter? This seems to be an issue only with non
primitive types because I can invoke git step as git "repo_path" and it
works correctly.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/e880cb2a-5d15-487e-8fe3-e2a68bedc62f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.