Why doesn't Maven's mvn clean ever work the first time?

Posted by hoffmandirt on Stack Overflow See other posts from Stack Overflow or by hoffmandirt
Published on 2009-10-23T19:09:05Z Indexed on 2010/03/23 4:31 UTC
Read the original article Hit count: 336

Filed under:

Nine times out of ten when I run mvn clean on my projects I experience a build error. I have to execute mvn clean multiple times until the build error goes away. Does anyone else experience this? Is there any way to fix this within Maven? If not, how do you get around it? I wrote a bat file that deletes the target folders and that works well, but it's not practical when you are working on multiple projects. I am using Maven 2.2.1.

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to delete directory: C:\Documents and Settings\user\My Documents\software-developm
ent\a\b\c\application-domain\target. Reason: Unable to delete directory C:\Documen
ts and Settings\user\My Documents\software-development\a\b\c\application-domai
n\target\classes\com\a\b

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Fri Oct 23 15:22:48 EDT 2009
[INFO] Final Memory: 11M/254M
[INFO] ------------------------------------------------------------------------

© Stack Overflow or respective owner

Related posts about maven-2