How to emit XML in Jenkinsfile, and documentation on all Jenkinsfile restrictions?

32 views
Skip to first unread message

David Karr

unread,
Nov 15, 2016, 11:29:58 AM11/15/16
to Jenkins Users
I'm stepping through implementing required features for our build in a Pipeline job.  I've been hitting restrictions on what I can do with Groovy in a Jenkinsfile.  Right now, I can't figure out how to just emit valid XML. When I try to use MarkupBuilder, it tells me that I can't use "new MarkupBuilder" or "new StringWriter".  I tried other strategies, but those use static methods, which are also apparently not allowed.

I need to solve this particular problem, but I also need better understanding of the overall restrictions in a Jenkinsfile, and perhaps WHY those restrictions are there.

Daniel Beck

unread,
Nov 15, 2016, 3:32:44 PM11/15/16
to jenkins...@googlegroups.com

> On 15.11.2016, at 17:29, David Karr <davidmic...@gmail.com> wrote:
>
> I also need better understanding of the overall restrictions in a Jenkinsfile, and perhaps WHY those restrictions are there.

http://groovy-sandbox.kohsuke.org/
https://github.com/jenkinsci/workflow-cps-plugin/#pipeline-groovy-plugin

Note that Pipeline is best when it handles orchestration. T's not designed to be a substitute for actual build tools.

David Karr

unread,
Nov 15, 2016, 7:24:05 PM11/15/16
to Jenkins Users, m...@beckweb.net

Yup, I got that.  I have to communicate build notifications to an external system.  The build itself is all in Maven.
Reply all
Reply to author
Forward
0 new messages