Frequently Asked Questions

  1. I already ran mvn clean but the directory (put dir name here) is still there. What should I do?
  2. On Windows, I got "Unable to delete directory". What's wrong?
I already ran mvn clean but the directory (put dir name here) is still there. What should I do?

Some files-generating plugins can generate their files outside of the default directories being deleted by the clean plugin. You should add the location of such files in the clean plugin configuration or change the configuration of those plugins to put their files inside the project.build.directory which is by default, the target directory.

[top]


On Windows, I got "Unable to delete directory". What's wrong?

For instance, clean could fail if you already have opened a command line with target as the current dir. Windows locks some ressources and you need to close the handles on these ressources. To skip these errors, you could call clean with the command line parameter -Dmaven.clean.failOnError=false. For more information, refer to Ignoring Errors page.

Sysinternals produced a number of utilities, like Process Explorer or Handle that help you to deal with Windows handles.

[top]