Steps to reproduce the problem:
1) Create a Group.
2) Add a Maven 2 Project on it.
3) Force Build
4) Create another Group
5) Move the project to the other group
6) Try to delete the old group (The exception will be raised, complaining that there are )
Delete all the build history for the moved projects before attempting to delete the old group.