hudson compiler and source character encoding

We recently has a strange problem occurring on our continuous integration server (which uses the hudson) on a specific maven build.
Some code was checked in which included the following line

final protected static char CONCATENATION_SEPERATOR = '§';

Nothing very special you would assume, and all compiled fine locally (on two systems I might add).

Hudson however reported errors like :[24,58] unclosed character literal :[24,60] illegal character: \65533 :[24,61] unclosed character literal
no more tokens - could not parse error message: :122: ';' expected

It was clearly not handling the character (encoding). Now all our source files are UTF-8, but hudson doesn’t seem to pick this up.

To fix it, we explicitly told the java compiler (javac) what the file encoding is. This was done using the following excerpt from the master pom file (note that this also ensures java 5 is used for compilation – that bit was already in there).


Leave a Reply

Your email address will not be published. Required fields are marked *

question razz sad evil exclaim smile redface biggrin surprised eek confused cool lol mad twisted rolleyes wink idea arrow neutral cry mrgreen