Okay. I\'m sick of this problem. This has to have an easy fix, I\'m sure of it!! I hope SO can help me to get rid of this once and for all!
I encountered a similar problem and resolved it by moving the folder into my project folder. I then went to:
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.
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.
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
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
).
If you really want to exclude certain classes/packages from autobuild you can just right click on them and select Build Path -> Exclude