Yeah, JobDSL always has the configure block option. I agree it is ugly but in the short term it give you a work around (you could wrap that in method call and put it in a library to make it look cleaner).
This sounds like something that would be better to fix/enhance in the JobDSL plugin. Maybe it could detect this from context? In the DSL,
is a descendant of
, the package for which is
. If there a trait in the same package, it would seem reasonable to choose it instead of failing. Then all the branch source plugins would be fixed in one shot.
Of course, I don't know enough about the JobDSL plugin to know if that would be difficult.