版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Geralt3/article/details/75925802
在运行Maven项目时报错
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project taotao-manager-web: Failed to clean project: Failed to delete E:\JAVA\project\taotao-manager\taotao-manager-web\target\tomcat\logs\access_log.2017-07-23 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :taotao-manager-web
错误原因是描述中的文件被占用,无法删除导致错误。关闭Eclipse程序再启动可解决问题。
但每次反复关闭程序也不是办法,之后我找到文件所在位置,手动删除文件,会提示
接着我通过任务管理器-性能-打开资源监视器-CPU-关联的句柄中搜索文件
发现是被javaw.exe程序占用,在任务管理器中强制结束进程也可解决问题。
经查询后发现大多同样的问题是IO传输文件后未关闭流导致,
根本解决方案为在每次运行项目后点击除去启动 再点击旁边红色的结束按钮即可
找到对应目录发现文件已被删除。