vladmihalcea / high-performance-java-persistence

The High-Performance Java Persistence book and video course code examples
Apache License 2.0
1.31k stars 489 forks source link

Set source code encoding to UTF-8 #54

Closed ittrad-mobile-lab closed 4 years ago

ittrad-mobile-lab commented 4 years ago

In case you got this error Error: unmappable character ... for encoding US-ASCII when: mvn clean test-compile

the only solution I found was to setup the UTF-8 into the /high-performance-java-persistence-master/core/pom.xml like this:

<properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 </properties>
vladmihalcea commented 4 years ago

Which class throws that error?

ittrad-mobile-lab commented 4 years ago

Please find below:

[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for high-performance-java-persistence 1.0-SNAPSHOT:
[INFO] 
[INFO] high-performance-java-persistence .................. SUCCESS [  0.340 s]
[INFO] high-performance-java-persistence-core ............. FAILURE [  5.154 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.605 s
[INFO] Finished at: 2020-04-21T16:42:31+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:testCompile (default-testCompile) on project high-performance-java-persistence-core: Compilation failure: Compilation failure: 
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/type/json/PostgreSQLJsonBinaryTypeTest.java:[87,48] error: unmappable character (0xC8) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/type/json/PostgreSQLJsonBinaryTypeTest.java:[87,49] error: unmappable character (0x9B) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/mapping/GeneratedTest.java:[34,31] error: unmappable character (0xC3) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/mapping/GeneratedTest.java:[34,32] error: unmappable character (0xAD) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/mapping/GeneratedTest.java:[36,28] error: unmappable character (0xC3) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/mapping/GeneratedTest.java:[36,29] error: unmappable character (0xA8) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/mapping/GeneratedTest.java:[42,38] error: unmappable character (0xC3) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/mapping/GeneratedTest.java:[42,39] error: unmappable character (0xAD) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/mapping/GeneratedTest.java:[42,55] error: unmappable character (0xC3) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/mapping/GeneratedTest.java:[42,56] error: unmappable character (0xA8) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/mapping/GeneratedTest.java:[49,32] error: unmappable character (0xC3) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/mapping/GeneratedTest.java:[49,33] error: unmappable character (0xB3) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/mapping/GeneratedTest.java:[54,33] error: unmappable character (0xC3) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/mapping/GeneratedTest.java:[54,34] error: unmappable character (0xB3) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/type/json/PostgreSQLJsonStringTypeTest.java:[75,48] error: unmappable character (0xC8) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/type/json/PostgreSQLJsonStringTypeTest.java:[75,49] error: unmappable character (0x9B) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/type/json/MySQLJsonTypeTest.java:[82,48] error: unmappable character (0xC8) for encoding US-ASCII
[ERROR] /high-performance-java-persistence-master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/type/json/MySQLJsonTypeTest.java:[82,49] error: unmappable character (0x9B) for encoding US-ASCII
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
vladmihalcea commented 4 years ago

I see. I'll add the proposed change.

vladmihalcea commented 4 years ago

Fixed.