The problem is that CPD generates invalid xml files when used on Windows. The standard encoding is Cp1252 which is not an official character set.
This results in problems down stream when the xml is parsed by a Jenkins plugin, the Digester3 parser will throw an exception that the encoding is not recognized.
The cause is that the XmlRenderer is created BEFORE the encoding argument is processed. The fix is simple, process the encoding argument before the format argument.
I have created a pull request for this on github:
https://github.com/pmd/pmd/pull/27
Hi Peter, thanks for the pull request. It is integrated in the source code, but we are not sure, when we will release a next version.
Can you try, whether adding the system property "
-Dfile.encoding=UTF-8
" would be a workaround for you?Simply add it to the
OPTS
variable incpd.bat
or directly to the java call.Regards,
Andreas