score:31

Accepted answer

you can use the configure contents... on the menu of problems panel. there you can create a new configuration and set the scope to on working set:. click on select... and create a new working set that excludes the folders you don't want.

score:-2

the best approach is to use the inclusion and exclusion patterns option in the java build path.
for example if you want to exclude one project of being automatically build:
1- go to its properties->java build path->source.
2- expand the folder in the "source folders on the build path:" area
3- select exclude->edit
4- in the exclusion patterns add **
note: for more information on this patterns: include and exclusion patterns

score:-1

since the files in the resource folder rarely change, i suggest to put them into a second project (where you can set different warning options) and then access that via a relative path (like ${basedir}/../special-tomcat).

score:0

configure your project (project/properties/java build path/source) to have, instead of the top level src folder with exclusions, just a list of the folders you do want to compile.

assuming eclipse helios, step by step:

  • turn off autobuild (project/build automatically).
  • start with it empty.
  • delete the errors by right clicking as in the link (just to be sure).
  • add genuine source folders 1 by 1 (project/properties/java build path/source/add folder)
  • do an explicit build (project/build project).

if that works, you should be able to turn autobuild back on. if it doesn't, something strange is going on. perhaps the project is not using the standard java builder, but something like an ant builder (project/properties/builders).

score:0

go to java build path -> source -> add folder

choose the right folders which needs to be part of build path

in the above screen shot src/main/resources needs to be removed from the build as it results in compilation error [wrong package id]. hence include the folder till src/main/resources .

i did try build path -> exclude. this does not actually solve the problem. i.e though the redx mark is cleared from the eclipse, it will no more be right java projects. i.e user may not be able to run junit test cases/ debug etc.

but by including right folders, we can continue with as java project.

score:3

if you really want to exclude certain classes/packages from autobuild you can just right click on them and select build path -> exclude

alt text

score:8

there is an eclipse feature request for ignoring warnings from specified source folders. there have been several patches posted to the comment thread that provide implementations of the feature. it appears that a final patch is nearing the review stage for inclusion in an upcoming release.

update 6/19/2012: eclipse juno 4.2m6 supports ignoring problems for a particular source folder. the feature is available on the java build path dialog. see the release note.

score:61

i encountered a similar problem and resolved it by moving the folder into my project folder. i then went to:

  1. project > properties > resource > resource filters > add...
  2. set filter type = exclude all.
  3. set applies to = folders.
  4. set file and folder attributes = { name, matches, < your_folder_name > }

Related Query

More Query from same tag