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>
I had the same issue, and it was cause by the Maven resources plugin which filtered and altered my Excel files.
To prevent this to happen, add something like this (see the Maven doc) :
<build> <resources> <resource> <filtering>true</filtering> <directory>src/test/resources</directory> <excludes> <exclude>**/*.xls</exclude> </excludes> </resource> ...
UPDATE : Copy in resources, but don't filter
<resources> <resource> <directory>src/test/resources</directory> <filtering>true</filtering> <excludes> <exclude>**/*.xls</exclude> </excludes> </resource> <resource> <directory>src/test/resources</directory> <filtering>false</filtering> <includes> <include>**/*.xls</include> </includes> </resource> ... </resources>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With