Re: Calling Java from jenkinsfile to parse XML

15 views
Skip to first unread message

Robert Sandell

unread,
Apr 12, 2019, 12:49:00 PM4/12/19
to jenkin...@googlegroups.com
A quick google search revealed the following interesting articles


In your plugin are you performing the parsing on the master or on the agent (via for example file.act(...)) It shouldn't make any difference but maybe some dirty data is suffixed in the transfer or something?

/B

Den tors 11 apr. 2019 kl 17:50 skrev Matt Q <matthew....@gmail.com>:
I am trying to call some Java code in our plugin from the jenkinsfile to parse XML (I have been able to parse it in the jenkinsfile but would like to abstract the implementation from the pipeline). I am passing an XML file to a method that works fine when this file is passed from within the plugin code but fails when I pass the very same file from the pipeline:

Exception: Content is not allowed in prolog.

There is no content in the prolog:

<?xml version="1.0" encoding="UTF-8"?>
<project version="27">
  <config>
  ...

I have checked that the file is encoded in UTF-8 and several other suggestions but this error persists. Is this a known issue when trying to invoke Java from the pipeline? I can't figure out why the same code is behaving differently when invoked this way.

-Matt

--
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 jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/279d5d75-cad5-4abe-82d0-ab438b82c056%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Robert Sandell
Software Engineer
CloudBees, Inc.
CloudBees-Logo.png
Twitter: robert_sandell
Reply all
Reply to author
Forward
0 new messages