maven... Failed to clean project: Failed to delete ..\org.ow2.util.asm-asm-tree-3.1.jar

user2740224 picture user2740224 · Oct 21, 2013 · Viewed 160k times · Source

I use STS(spring tool suite) + maven plugin.

Every time when I run my application using maven-clean I see following error:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building hhsystem ui 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ui ---
[INFO] Deleting C:\Users\Nikolay_Tkachev\workspace\HHSystem\UI\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.471s
[INFO] Finished at: Mon Oct 21 12:34:33 MSK 2013
[INFO] Final Memory: 2M/90M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project ui: Failed to clean project: Failed to delete C:\Users\Nikolay_Tkachev\workspace\HHSystem\UI\target\org.ow2.util.asm-asm-tree-3.1.jar -> [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

I have to close STS and go to C:\Users\Nikolay_Tkachev\workspace\HHSystem\UI\target and delete org.ow2.util.asm-asm-tree-3.1.jar

After starting STS again it works, but this is a hassle.

Can you help me with this problem?

UPDATE
for Kalathoki L.

I run maven-clean from this state:

STS screen shot

I see same behaviour from the command line as from the eclipse plugin

If I watch unlocker when STS is running I see

unlocker screen shot:

Answer

Yubaraj picture Yubaraj · Oct 21, 2013

Stop your server before you start to clean.

Stopping a server

You can stop the server from the Servers view.

To stop the server:

  1. In the Servers view ( Window > Show View > Other > Server > Servers > OK), select the server that you want to stop.
  2. Click the Stop the server this icon in the toolbar. In the Servers view, the status of the server changes to Stopped.
  3. If for some reason the server fails to stop, you can terminate the process as follows:

    a. Switch to the Debug perspective.

    b. In the Process view, select the server process that you want to stop.

    c. Click the Terminate This is an image of the Terminate icon in the toolbar.

Note: When terminating a server, the server process will end and the server will not go through the normal routine of stopping, for example calling the destroy() method on a servlet.

Source: Eclipse Help