【异常】File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!

From: https://www.cnblogs.com/duanxianyouyang/p/14679926.html

File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

解决方法:在pom中增加以下配置

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

  

另一个表现就是:mvn编译成功,但是程序运行时却出现错误,大致是编码问题导致的!

posted on 2023-12-14 23:11  清清飞扬  阅读(231)  评论(0)    收藏  举报