Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot change Platform Encoding #567

Closed
Hccake opened this issue Jan 6, 2022 · 3 comments
Closed

Cannot change Platform Encoding #567

Hccake opened this issue Jan 6, 2022 · 3 comments

Comments

@Hccake
Copy link

Hccake commented Jan 6, 2022

On Windows, by setting environment variables MAVEN_OPTS

-Dfile.encoding=UTF-8

You can modify Maven's default Platform Encoding, but I found it didn't work with MVND

PS C:\> mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: D:\software\apache-maven-3.6.3\bin\..
Java version: 1.8.0_291, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_291\jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
PS C:\> mvnd -v
mvnd native client 0.7.1-windows-amd64 (97c587c11383a67b5bd0ff8388bd94c694b91c1e)
Terminal: org.jline.terminal.impl.jansi.win.JansiWinSysTerminal
Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Maven home: D:\software\mvnd-0.7.1-windows-amd64\mvn
Java version: 1.8.0_291, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_291\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
@gnodet
Copy link
Contributor

gnodet commented Jan 6, 2022

The mvnd native executable does not support the MAVEN_OPTS environment variable.
You can either use the command line by adding -Dfile.encoding=UTF-8 or adding this option in the [project-home]/.mvn/jvm.config.

@ppalaga
Copy link
Contributor

ppalaga commented Jan 6, 2022

You may also try to add the following line to ~/.m2/mvnd.properties:

mvnd.jvmArgs=-Dfile.encoding\=UTF-8

@Hccake
Copy link
Author

Hccake commented Jan 7, 2022

You may also try to add the following line to ~/.m2/mvnd.properties:

mvnd.jvmArgs=-Dfile.encoding\=UTF-8

Thanks for replying, it works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants