bertolami bertolami - 7 days ago 7
Java Question

Excel file corrupt when copied from src to target in Eclipse IDE

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.

Answer

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>
Comments