javafan2011 wrote:
> I have multi module project where one project contains excel spreadsheet
> and it is being dropped in the target folder when maven build the project.
> Now when I do a mvn clean install, sometime maven throws an error that it
> can not delete the "abc.xls" file. So I started using maven-clean-plugin
> and trying to exclude this file. Still I am getting the same error.
> Strange problem is, if i close my eclipse and do the build from command
> line then it works fine. But for that everytime i want to do clean build I
> have to close my eclipse. Also I am using M2ECLIPSE plugin for my project.
> Here is my maven-clean-plugin looks like
>
>
> maven-clean-plugin
> 2.4.1
>
>
>
>
> ${basedir}/target/classes/
>
> **/*.xls
>
>
>
>
>
>
> Any insight would be helpful.
In short: Write proper tests!
You're actually working on Windows and that file is created/opened during a
unit test, but the OutputStream/InputStream is not properly closed i.e.
Windows has an open file handle. Unless this file handle exists, you cannot
delete the file. Closing Eclipse will obviously terminate the parent process
of the file handle.
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]