Spring Boot2 solve garbled idea console console output

Idea default configuration is the use of GBK, and the project file uses UTF-8.

Coding inconsistencies, resulting in garbled idea Console console output.

Internet solutions, mostly directly modify the Settings => Editor => File Encodings following configuration, as shown below:

The Global Encoding, which is the global configuration coding format, configured with the Project Encoding encoding format into the same project on OK.

Global sometimes not the same as the encoding format of the project, so try not to move.

But revised Project Encoding, but also to solve the garbage problem can not console the Console.

So think of the following solutions:

spring-boot-maven-plugin package plug-in is used to compile the project, so if you can make a fuss about it from here?

Bold attempt, the eventual adoption of the following add Configuration configuration to solve the garbage problem.

In pom.xml

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <!-- 指定文件编码,即可解决  -->
                <configuration>
                    <arguments>-Dfile.encoding=UTF-8</arguments>
                </configuration>
            </plugin>
        </plugins>
    </build>

That solved the Console console garbled, it does not modify the Global Encoding this global configuration parameters.

Guess you like

Origin www.cnblogs.com/werewolfBoy/p/11388196.html