Stop your server before you start to clean.
Stopping a server
You can stop the server from the Servers view.
To stop the server:
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
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
You may also try try -Dmaven.clean.failOnError=false
(from Maven FAQ)
Delete the java.exe process in Task Manager and run mvn clean install.It worked for me.
Your problem is that a running process within STS is using files located in your target directory while you execute a mvn clean
command. Maven will be unable to delete these files (since other processes are still accessing them) and thus fail with that error.
Try to stop all processes (tests, servers, applications) from within STS before running Maven console commands. Look out: This behaviour might also appear if STS is cleaning up the projects and thus re-compiles the sources, and not running a process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With