Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot delete target directory after removing Maven nature of project

I decided not to use maven in my project. So, I right-clicked it in Eclipse and then "Remove maven nature". Everything seems to be ok, but I cannot remove the target directory. If I delete it from within Eclipse it's just created again, if I delete it from Explorer the result is the same, as soon as I clean my project from Eclipse it's just created again.

Where am I wrong?

Thanks in advance.

like image 833
Michael Avatar asked May 07 '12 08:05

Michael


People also ask

Can I delete the target folder Maven?

It is not able to delete because you must be accessing some file from it. So simple solution would be to close any files which you might have opened from target folder [inside or outside eclipse]. Once you dont access the folder or any of its contents then folder shld get deleted.

Which command can be used to remove a target directory?

rm command – removes a directory/folder along with all the files and sub-directories in it.

Does mvn clean delete target?

When “mvn clean” is executed, everything under “target” folder will be deleted.

Which of the following command is used to remove the files that are generated in target folder?

Explanation. mvn clean command removes the target directory with all the build data before starting the build process.


1 Answers

To disable & remove Maven target directory

  1. Right click on the project -select Maven->Disable Dependency Management.
  2. Right click on project - select Build Path-> Configure Build Path -> Source Tab. Untick "Allow output folder for source folders"
  3. Now type "Your Project Name"/bin eg. TestProject/bin, in the Default Output Folder field to point to default.
  4. Now click ok and delete the target directory.
like image 90
Bitmap Avatar answered Oct 02 '22 13:10

Bitmap