1. 程式人生 > >Maven Compile Encoding 亂碼問題解決

Maven Compile Encoding 亂碼問題解決

在hudson使用Maven構建專案,遇到警告:

[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!

修改pom.xml,新增下面的內容:

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

沒有警告了,佈置到tomcat上也沒有亂碼了