Maven无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.5:clean无法删除access_log [英] Maven Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean Failed to delete access_log

查看:755
本文介绍了Maven无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.5:clean无法删除access_log的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用maven和tomcat运行简单的struts项目。

I'm trying to run simple struts project using maven and tomcat.

当我尝试执行下一个目标时:清理安装tomcat7:运行我收到 MojoExecutionException

When I'm trying to exucute next goals: clean install tomcat7:run I'm getting MojoExecutionException :

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean
(default-clean) on project myproject: Failed to clean project: Failed to delete
D:\EclipseWorkspace\myproject\target\tomcat\logs\access_log.2015-02-21
-> [Help 1]

我用Google搜索并了解tomcat使用此 access_log 文件,用于记录用户请求。当我想要执行上面列出的目标时,因为我正在使用Eclipse IDE,JVM拒绝删除此文件。

I've googled and understand that tomcat uses this access_log file, where he logs user requests. And by the time when I want to execute goals listed above, as I'm using Eclipse IDE, the JVM denies for deleting this file.

我看到了同样的问题:< a href =https://stackoverflow.com/questions/11806786/failed-to-execute-goal-org-apache-maven-pluginsmaven-clean-plugin2-4-1>无法执行目标org.apache.maven .plugins:maven-clean-plugin:2.4.1 , Maven - 无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean

I saw same questions: Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1, Maven - Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean.

但是不明白这个问题的建议解决方案。

But don't understand the proposed solutions to such problem.

推荐答案

我见过这种每当有一个进程对某个Maven试图清理的子文件夹中的文件进行锁定时,就会出现错误。检查您的Tomcat实例是否真的停止了(在任务管理器中查找不应存在的Java进程)。我还通过在文本编辑器中打开访问日志,然后在关闭Tomcat并尝试运行新构建之后忘记关闭编辑器来为自己创建此问题。

I've seen this sort of error whenever there's a process that's holding a lock on a file in some subfolder that Maven is trying to clean. Check that your Tomcat instance is really stopped (look for java processes in Task Manager that shouldn't be there). I've also created this issue for myself by opening the access log in a text editor, and then forgetting to close the editor after shutting down the Tomcat and trying to run a new build.

这篇关于Maven无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.5:clean无法删除access_log的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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