File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent

问题:编译打包(mvn clean install)文件总是为GBK格式,不是UTF-8格式

原因分析:使用了默认编码格式GBK

解决方案:pom文件添加配置

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

执行结果:

猜你喜欢

转载自blog.csdn.net/weixin_38023225/article/details/113136237
今日推荐