網頁

2020/4/30

Maven WARNING Using platform encoding to copy filtered resources

在maven build時出現下面警告:
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!


出現警告的原因是maven plugins沒有指定resource的編碼(encodeing)類型。

pom.xml<project><properties>中新增<project.build.sourceEncoding>來指定編碼

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

參考:

沒有留言:

張貼留言