This is an IO exception that indicates a mismatch between the bytes of a file and its encoding. For instance, if a POM file declares

<?xml version="1.0" encoding="UTF-8"?>

in its header, its binary contents must be a valid UTF-8 byte sequence. This means that any non-ASCII character needs to be encoded as a sequence of two or more bytes. A file whose contents are not properly encoded, e.g. because a user edited/saved the file in another encoding than specified in the XML declaration, can cause this exception. The file content is invalid and needs to be re-encoded to fit the declared encoding or the encoding given by the XML declaration needs to be adjusted to match the content.

  • No labels