Quand j'essayer projet de paquet avec Maven, je reçois ceComment mieux mettre en place des propriétés de codage machine virtuelle Java en UTF-8
...
-------------------------------------------------------
T E S T S
-------------------------------------------------------
...
2017-09-23 14:00:11.447 ERROR 11468 --- [ main] o.s.b.c.FileEncodingApplicationListener : System property 'file.encoding' is currently 'Cp1252'. It should be 'UTF-8' (as defined in 'spring.mandatoryFileEncoding').
2017-09-23 14:00:11.464 ERROR 11468 --- [ main] o.s.b.c.FileEncodingApplicationListener : Environment variable LANG is 'null'. You could use a locale setting that matches encoding='UTF-8'.
2017-09-23 14:00:11.464 ERROR 11468 --- [ main] o.s.b.c.FileEncodingApplicationListener : Environment variable LC_ALL is 'null'. You could use a locale setting that matches encoding='UTF-8'.
2017-09-23 14:00:11.802 ERROR 11468 --- [ main] o.s.boot.SpringApplication : Application startup failed
java.lang.IllegalStateException: The Java Virtual Machine has not been configured to use the desired default character encoding (UTF-8).
Il peut être fixé comme: ajoutez Variable d'environnement JAVA_TOOL_OPTION
= -Dfile.encoding="UTF-8"
mais ne le font pas travaux.
Dans IntelliJ Idea Paramètres tout est réglé sur UTF-8.
aplication.properties
spring.mandatory-file-encoding=UTF-8
pom.xml
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<file.encoding>UTF-8</file.encoding>
<java.version>1.8</java.version>
</properties>
Utilisation de Windows 10.
est l'une de ces propriétés utilisées dans 'maven-compilateur-plugin '? – nullpointer
Non, ils ne sont pas utilisés par maven-compiler-plugin. 'java.version' est utilisé par spring-boot, mais seulement si vous utilisez le parent de démarrage de printemps. Sinon, cela ne fonctionne pas de cette façon ... – khmarbaise