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