radai rosenblatt created KAFKA-4025: ---------------------------------------
Summary: build fails on windows due to rat target output encoding Key: KAFKA-4025 URL: https://issues.apache.org/jira/browse/KAFKA-4025 Project: Kafka Issue Type: Bug Environment: windows 7, wither regular command prompt or git bash Reporter: radai rosenblatt Priority: Minor kafka runs a rat report during the build, using [the rat ant report task|http://creadur.apache.org/rat/apache-rat-tasks/report.html], 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|http://svn.apache.org/repos/asf/creadur/rat/tags/apache-rat-project-0.11/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java] line 196): {noformat} out = new PrintWriter(new FileWriter(reportFile));{noformat} 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: {noformat} com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.{noformat} (see complete output of {{gradlew --debug --stacktrace rat}} in attached file) -- This message was sent by Atlassian JIRA (v6.3.4#6332)