I\'m using maven 2.0.9 with Eclipse 3.3.2.
I\'m used to launching a fresh build once per day by a mvn clean install
.
Then, if I refresh my Eclipse project,
Using Resource filter looks solve issue if you using 'mvn clean install' frequently.
Basically it will add 'target' to and sub folders to exclude folder directly to .project file. After run this script, if you import project to eclipse, you can see the setting 'Project'->'Properties'->'Resource'->'Resource Filters'. Before this whenever I run mvn clean install, eclipse took 50% of my CPU but now it stay under 5% while build project.
function eclipse-setup() {
mvn eclipse:clean
mvn eclipse:eclipse
#maven target folders
find . -name .project -exec sed -i.MSORG 's/<\/projectDescription>/ 1314376338264<\/id> <\/name> 26
<\/type> org.eclipse.ui.ide.multiFilter<\/id> 1.0-name-matches-false-false-target<\/arguments> <\/matcher> <\/filter> 1314387234341<\/id> <\/name> 6<\/type> org.eclipse.ui.ide.multiFilter<\/id> 1.0-name-matches-false-fals
e-*.cache.html<\/arguments> <\/matcher> <\/filter> <\/filteredResources><\/projectDescription>/' {} \;
}