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:
clean install tomcat7:run
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.
access_log
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.
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.
Micahel Peacock and khmarbaise were right, as some processes block deletion.
maven, .
, Tomcat maven clean install tomcat7:run shutdown ${CATALINA_HOME}/bin, Eclipse Tomcat, :
Tomcat
shutdown
${CATALINA_HOME}/bin
, :
locale tomcat , , .
, maven i.e. mvn clean, :)
Fedora. targe root usring → [chown your-username target] .