make eclipse rebuild mvn project after switching git branches

When I switch my git branch in eclipse (using egit plugin) I always need to do a mvn clean and generate-source call afterwards to get my code in a good state. It’s mildly annoying to do, and I risk forgetting to do it some time and running on stale code without realizing it.

Is there a way to add some sort of hook into eclipse that will run when I switch my git branches, where i can tell it to rebuild with maven immediately afterwards?

Git Baby is a git and github fan, let's start git clone.