JAXB and unmappable character for encoding UTF-8

Using locale specific characters in schema or wsdl (i.e. for documentation purpose) is still quite problematic. Especially if you are using JAXB to generate wsdl2java java classes. Because JAXB uses default system encoding and classes are usually compiled in UTF-8 special chars in java comments resolves in compilations error:

/url/to/file/SomeFile.java:[11,12] unmappable character for encoding UTF-8 A workaround to this problem is to isolate wsdl2java code generation in a dedicated maven module and to configure the compiler plugin to use OS dependant encoding:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <encoding>${file.encoding}</encoding>
        </configuration>
</plugin>

More info related to this topic:

here

You May Also Like

micro-burn has Trello integration

After a few long evenings I've finally integrated micro-burn with Trello. All you need to run it for your Trello board is to write short configuration and run fat jar. It renders burndown chart visualising progress of cards on your board.You can specif...After a few long evenings I've finally integrated micro-burn with Trello. All you need to run it for your Trello board is to write short configuration and run fat jar. It renders burndown chart visualising progress of cards on your board.