Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
windows 7, either regular command prompt or git bash
Description
kafka runs a rat report during the build, using the rat ant report task, which has no output encoding parameter.
this means that the resulting xml report is produced using the system-default encoding, which is OS-dependent:
the rat ant task code instantiates the output writer like so (org.apache.rat.anttasks.Report.java line 196):
out = new PrintWriter(new FileWriter(reportFile));
which eventually leads to Charset.defaultCharset() that relies on the file.encoding system property. this causes an issue if the default encoding isnt UTF-8 (which it isnt on windows) as the code called by printUnknownFiles() in rat.gradle defaults to UTF-8 when reading the report xml, causing the build to fail with:
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
(see complete output of gradlew --debug --stacktrace rat in attached file)