在 Eclipse IDE 中从 src 复制到目标时 Excel 文件已损坏 [英] Excel file corrupt when copied from src to target in Eclipse IDE
本文介绍了在 Eclipse IDE 中从 src 复制到目标时 Excel 文件已损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个关于 eclipse 的奇怪问题.当我将 .xls 文件放入 src/test/resources
路径时,它会被 eclipse 复制到 target
路径.
I have a strange issue with eclipse. When I put a .xls file in the src/test/resources
path it is copied by eclipse to the target
path.
然而,目标路径中的文件不再相同.我无法再在 MS Excel 中打开它,当我比较这两个文件时,我看到了一些二进制差异.怎么会这样?
However, the file in the target path is not the same anymore. I cannot open it in MS Excel anymore and when I compare the two files, I see some binary differences. How can this happen?
PS:我的eclipse环境是用maven生成的.
PS: my eclipse environment is generated with maven.
推荐答案
感谢上面的回答,我们找到了处理问题的方法:
Thanks to the above answers we found out how to deal with the problem:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>xls</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
这篇关于在 Eclipse IDE 中从 src 复制到目标时 Excel 文件已损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文