Pipeline DSL objects - class-loaders and compilation

21 views
Skip to first unread message

Oliver Gondža

unread,
May 11, 2017, 4:36:15 AM5/11/17
to jenkin...@googlegroups.com
I am reviving pipeline support for openstack-cloud plugin[1]. I am
somewhat surprised by several things that seems to be common across
multiple pipeline supported plugins:

- The DSL objects are written in groovy _and_ attached as a resource to
be compiled at runtime.
- They are loaded by the classloader of the CpsScript object and not the
one of the plugin that distribute it (which seems to break plugin-first
classloading).

Is that a random maintainer decision or is there some reason behind that
I do not see? (Is that because of CPS and making the DSL methods itself
continuable?) Is that the only limitation I will observe if I provide a
compile-time compiled java class to pipeline instead? What about the
classloader?

[1]
https://github.com/jenkinsci/openstack-cloud-plugin/pull/145/files#r112932744

Thanks, Jesse!
--
oliver

ogondza

unread,
May 12, 2017, 5:30:15 AM5/12/17
to Jenkins Developers
Thanks for commenting on the PR. Am I right to assume that there is no practical advantage to distribute the objects that are returned into pipeline as runtime-compiled groovy, much less loading it through pipeline provided classloader? Returning POJOs of compiled classes is the way to go...

Thanks.
--
oliver
Reply all
Reply to author
Forward
0 new messages