Da ich mein Windows 10 aktualisiert und neue OpenJDK 11.0.4 installiert habe, werden meine Feder -Integrationstests im Maven -Kontext nicht mehr ausgeführt. Das Starten in Eclipse ist in Ordnung und funktioniert immer noch, aber mit MVN Clean Install funktioniert es nicht mit dem Fehler: < /p>
18:01:01.340 ERROR [main]:[org.springframework.boot.context.FileEncodingApplicationListener] System property 'file.encoding' is currently 'Cp1252'. It should be 'UTF-8' (as defined in 'spring.mandatoryFileEncoding').
18:01:01.341 ERROR [main]:[org.springframework.boot.context.FileEncodingApplicationListener] Environment variable LANG is 'null'. You could use a locale setting that matches encoding='UTF-8'.
18:01:01.341 ERROR [main]:[org.springframework.boot.context.FileEncodingApplicationListener] Environment variable LC_ALL is 'null'. You could use a locale setting that matches encoding='UTF-8'.
18:01:01.344 ERROR [main]:[org.springframework.boot.SpringApplication] Application run failed
java.lang.IllegalStateException: The Java Virtual Machine has not been configured to use the desired default character encoding (UTF-8).
at org.springframework.boot.context.FileEncodingApplicationListener.onApplicationEvent(FileEncodingApplicationListener.java:76)
at org.springframework.boot.context.FileEncodingApplicationListener.onApplicationEvent(FileEncodingApplicationListener.java:47)
< /code>
Ich habe überall die UTF-8-Codierung festgelegt, wo ich festlegen konnte.file.encoding=UTF-8
spring.mandatoryFileEncoding=UTF-8
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
< /code>
< /blockquote>
In den Maven -Eigenschaften und Plugin -Konfigurationen: < /li>
< /ol>
UTF-8
UTF-8
Java 11
true
11
${project.artifactId}-${build-version}
org.apache.maven.plugins
maven-compiler-plugin
${java.version}
UTF-8
org.apache.maven.plugins
maven-surefire-plugin
UTF-8
org.glassfish.jaxb
jaxb-runtime
2.4.0-b180830.0438
< /code>
In den Eigenschaften der Integrationstests: < /li>
< /ol>
@RunWith(SpringRunner.class)
@SpringBootTest(properties = "file.encoding=UTF-8", classes = SEBServer.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
< /code>
Beim Starten von Maven als VM -Argument < /li>
< /ol>
MVN Clean Installation -dfile.encoding = utf -8 < /p>
Kann jemand, wo ich mich sonst noch den Encoding einstellen kann? Es scheint so viele mögliche Orte wie Sterne am Himmel zu geben, aber nirgendwo das richtige.
Danke!
UTF-8-Codierung, die nicht für Federintegrationstests mit Maven unter Windows eingestellt sind ⇐ Java
-
- Similar Topics
- Replies
- Views
- Last post