为什么Maven的mvn clean第一次无法使用? [英] Why doesn't Maven's mvn clean ever work the first time?

查看:168
本文介绍了为什么Maven的mvn clean第一次无法使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

十分之九.我必须多次执行 mvn clean ,直到构建错误消失为止.还有其他人会遇到吗?有什么办法可以在Maven中解决此问题?如果没有,您如何解决?我写了一个bat文件,该文件删除了目标文件夹,并且效果很好,但是当您处理多个项目时,这是不切实际的.我正在使用Maven 2.2.1.

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

推荐答案

可能是您的IDE或其他进程正在按住目标"文件夹并阻止maven删除它.

It may be that your IDE or some other process is holding on to the the "target" folder and preventing maven from deleting it.

这篇关于为什么Maven的mvn clean第一次无法使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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