maven会对resource下的配置文件进行一次filter并重新编码, 就是这个过程导致了excel文件乱码, 只要将指定配置文件配置为不需要进行filter重编码即可:
<build>
...
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>config/**</exclude>
</excludes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<filtering>false</filtering>
<includes>
<include>**/mapper/*.xml</include>
<include>**/*.xls</include>
</includes>
</resource>
</resources>
...
</build>
网友评论