Eclipse - Hide the Maven Target Directory from Open Resource Shortcut

Okay, there are two Maven plugins for Eclipse: m2eclipse and Q for Eclipse.

I use m2eclipse and I am a big Maven fan.  Unfortunately, I don't want resources to show up from my target directory when I use the open resource shortcut. So how do we get around this?

From what I understand there are three ways to do this.
1. Edit a xml file in the UI jar
2. Use a plugin available from the Eclipse plugin site.
3. Add the "derived" property to the target folder.

I tried updating the UI jar in Eclipse 3.4 and didn't have much success. I also tried using the filter plugin, but it chokes the browser and doesn't seem to work that well.

So what I have found to be the best current approach is to do #3. The only problem is that if you delete the target directory at some point and make eclipse aware (by hitting refresh), you will lose the derived property and have to re-set it. The most common way this will happen is if you run a mvn clean from the command line. If you do that, make sure you don't refresh your project in eclipse until you have at least manually created a target folder.

In order to set the derived property, simple right click the target folder, click Properties, then check the derived checkbox and hit the Ok button.

You can then verify that it works by typing Control-Shift-R and then try specifying a file in your target folder.