Eclipse CVS and M2 Plugin: Prune Empty Directories Not Working

By default, Eclipse CVS is set to “Prune Empty Directories” when checking out a project from the repository. This is a problem if you are using the M2 plugin for maven projects in eclipse and that project has an empty directory that is part of the standard maven directory structure.

By default the .m2 plugin is looking for the following structure:

However if your directory src/main/resources is empty in CVS and you have “Prune Empty Directories” checked in the Eclipse Preferences, the m2 plugin gives you the following error:

To fix this normally you just need to go to “Window -> Preferences -> Team -> CVS -> File and Folders” and uncheck “Prune Empty Directories”

Alternatively, if you are not using the standard maven directory structure you can reconfigure the m2 plugin to accept your current settings by right clicking on the project going to M2 Maven -> Update Project Configuration.

However in my case:

  • I was using the standard maven directory structure.
  • I did have an empty /src/main/resources directory in the cvs repository
  • I did have “Prune Empty Directories” UN-CHECKED
  • But I still had the error.

Turns out in our version of eclipse you need to give it a bit of a “kick”

All we had to do was:

  • Go to “Window -> Preferences -> Team -> CVS -> File and Folders
  • Check “Prune Empty Directories” then UNCHECK “Prune Empty Directories” then hit “APPLY” and “OK”
  • Refresh project that the /src/main/resources error displays (for us the directory now shows up)
  • If the errors are still remaining at that point, replace the projects with latest from repository after refreshing and then they errors disappear.
  • And if that still doesn’t work for you, try deleting the offending source folder and re-add it back to the project in Java Build Path Property.

It's only fair to share...
Share on Facebook
Tweet about this on Twitter
Share on LinkedIn

Leave a Reply