79563849

Date: 2025-04-09 08:35:48
Score: 0.5
Natty:
Report link

After some research, this is probably related to the design decisions regarding what character encoding to use in Maven.

A probable short answer is:

"Platform dependent."

In IntelliJ with pressing Alt+F12, the PowerShell is displayed.

There should be a way to set the platform dependent value. Therefore, I tried in PowerShell on Windows. Please try (I don't have the proper plugins setup to test.)

[Console]::InputEncoding = [System.Text.UTF8Encoding]::new(); 
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new(); 
./mvnw spring-boot:run;

Then, use your ./mvnw command and see if it works.

The long background related to this probable answer:

See the information about the design that the platform encoding was used by plugins.

    * <<<$\{project.build.sourceEncoding\}>>> for
    {{{https://cwiki.apache.org/confluence/display/MAVEN/POM+Element+for+Source+File+Encoding}source files encoding}}
    (defaults to <<<UTF-8>>> since Maven 4.0.0, no default value was provided in Maven 3.x, meaning that the platform
    encoding was used by plugins)

See the background of POM Element for Source File Encoding. This is a long explanation of character encoding.

Default Value
As shown by a user poll on the mailing list and the numerous comments on this article, this proposal has been revised: Plugins should use the platform default encoding if no explicit file encoding has been provided in the plugin configuration.

Since usage of the platform encoding yields platform-dependent and hence potentially irreproducible builds, plugins should output a warning to inform the user about this threat, e.g.:

[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
This way, users can smoothly update their POMs to follow best practices.

For "[Console]::InputEncoding" discussion in PowerShell, see $OutputEncoding and [Console]::InputEncoding are not aligned -Windows Only.

Please see if this helps you.

Reasons:
  • Blacklisted phrase (1): this article
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Hdvlp