Cannot delete maven target folder in windows 8.1

1

I have used IntelliJ's maven plugin to build my project with mvn clean install. It fails on clean due to problems deleting certain folders within the target-directory.

I had this error multiple times and I could always solve it by utilizing unlocker or bash rm -rf <dir>, but not this time.

These are the things I tried to delete the folders:

  1. windows explorer > right-click > delete:

    seems to do nothing, not even output an error

  2. cygwin > bash rm -rf: rm:

    cannot remove 'tiny_mce/plugins/fullscreen': File exists

    rm: cannot remove 'tiny_mce/plugins/iespell': Directory not empty

  3. unlocker > delete:

    unlocker option selection

    error message: could not delete

  4. eclipse/intellij > delete

    Java IOException: cannot delete...

I hope there are other options since I cannot continue my work on my local machine as long as I have this problem. And I certainly do not want to switch my workspace and setup everything from the beginning under a new path. This can't be the solution!

Update:

  1. Moving the folder to another location

    Strangely, it worked. I still cannot delete that folder, but I could continue my work. However, I want it removed...

Manticore

Posted 2017-06-02T09:32:49.747

Reputation: 111

1

Take a look: http://maven.apache.org/plugins/maven-clean-plugin/faq.html

– duDE – 2017-06-02T13:17:03.663

thanks @duDE, I can successfully run the job by using -Dmaven.clean.failOnError=false but the folder is not removed, thus being packed into the war-file – Manticore – 2017-06-08T09:01:31.577

it also seems as if my filesystem got damaged or some sort of, since no tool ever can delete that folder. It can be moved but not deleted. I remember having had that issue years ago on Windows 98... – Manticore – 2017-06-08T09:02:48.350

Answers

0

The answer to my problem was to check my filesystem for damages and repair them.

So I ran chkdsk.exe /x /f /r, confirmed and restarted my system and voilà... I can finally delete that folder.

Manticore

Posted 2017-06-02T09:32:49.747

Reputation: 111