在Eclipse IDE中从src复制到目标时,Excel文件会损坏 [英] Excel file corrupt when copied from src to target in Eclipse IDE

查看:146
本文介绍了在Eclipse IDE中从src复制到目标时,Excel文件会损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的日食问题。当我将.xls文件放在 src / test / resources 路径中时,它被eclipse复制到目标路径。



但是,目标路径中的文件不再一样。我不能在MS Excel中打开它,当我比较两个文件时,我看到一些二进制的差异。如何发生这种情况?



PS:我的eclipse环境是用maven生成的。

解决方案

感谢上述答案,我们发现如何处理这个问题:

 < plugin> 
< artifactId> maven-resources-plugin< / artifactId>
< version> 2.5< / version>
< configuration>
< encoding> UTF-8< / encoding>
< nonFilteredFileExtensions>
< nonFilteredFileExtension> xls< / nonFilteredFileExtension>
< / nonFilteredFileExtensions>
< / configuration>
< / plugin>


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.

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: 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆