DigitalJoel

2009/11/16

How to remove cruft from Open Resource in Eclipse

Filed under: eclipse, java, maven — Tags: , — digitaljoel @ 1:07 pm

I got really tired of seeing my maven target directory and .svn directory entries show up in the ctrl+shift+R (open resource) dialog in Eclipse. Here’s what I did to remove them.

For .svn directories, I simply shared the project through subversive. I suspect doing the same with subclipse will work. Once eclipse knows that it is in version control, it removes the .svn directories from the Open Resource dialog.

For the maven target directory, I marked the directory as Derived. To do this, simply open the properties for the directory by pressing alt+enter or right clicking and selecting properties. Then, select the “Derived” property.

Set Directory to Derived

Derived Setting

Finally, you can remove the target directory from your Package Explorer using filtering. Simply select the little down arrow menu in the package explorer, then “filters”, and in the Name filter patterns, type “target”. Note that this will remove target from the Package Explorer, so if you want to mark it as Derived, you will need to do so before removing it from the Package Explorer.

Filtering in Package Explorer

Advertisements

1 Comment »

  1. Useful tip this.

    Comment by Babu — 2009/11/18 @ 11:35 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.