Maven Failed to complete target org.apache.maven.plugins: maven-clean-plugin: 2.5: clean Failed to delete access_log

I am trying to run a simple struts project using maven and tomcat.

When I try to derive the following goals: clean install tomcat7:runI get 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 am googled and understand that tomcat uses this file access_logwhere it logs user requests. And by the time I want to fulfill the above goals, since I use the Eclipse IDE, the JVM refuses to delete this file.

I saw the same questions: Failed to execute the target org.apache.maven.plugins: maven-clean-plugin: 2.4.1 , Maven - Failed to execute the target org.apache.maven.plugins: maven-clean-plugin: 2.4. 1: clean .

But I do not understand the proposed solutions to this problem.

+4
source share
4 answers

I saw this error whenever there is a process that locks a file in any subfolder that Maven is trying to clear. Make sure your Tomcat instance is really stopped (look for java processes in the task manager, which should not be). I also created this problem for myself by opening the access log in a text editor, and then forgot to close the editor after closing Tomcat and trying to start a new assembly.

+12
source

Micahel Peacock and khmarbaise were right, as some processes block deletion.

maven, .

, Tomcat maven clean install tomcat7:run shutdown ${CATALINA_HOME}/bin, Eclipse Tomcat, :

menu panel

, :

console view

locale tomcat , , .

+2

, maven i.e. mvn clean, :)

0

Fedora. targe root usring → [chown your-username target] .

0
source

All Articles