Java – Maven Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean Failed to delete access_log

eclipsejavamaventomcat

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

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]

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.

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.

Best Answer

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.

Related Topic