Excluding/Disabling Validation in Eclipse
Asked Answered
U

11

43

I have the (mis)fortune of having a large project source-base in which I am working primarily on PHP and JavaScript. I have to have the full project area as the project root in Eclipse, but unfortunately this includes several directories that drive the validation built into WST/DLTK/etc. nuts.

I have tried disabling all validators in the project properties. I have gone into the validators one at a time and added rules to the "Exclude Group" set to exclude the specific folders. I have removed the folders from the PHP build path in the project properties. And yet, my Problems view/tab is still littered with thousands of red flags that stem mostly from a folder that we use to keep copies of external elements (Apache, PHP, etc.). You know, typical "have a copy of the specific versions we currently use" sort of thing.

The signal-to-noise ratio is so bad that I'm unable to use the view at all, which is a shame. If I'm not going to have the benefits of the IDE, I might as well be using vim for this (I use it for other stuff, but for this codebase a good IDE is a better choice, providing I can get it to work). It seems to me that it would be an obvious feature to be able to right-click a folder in a project and select "Exclude from Validation", but alas there is no such feature. Is there another way to get the validators (PHP, HTML, etc.) to ignore the folders I need ignored?

Undergrowth answered 23/4, 2009 at 23:0 Comment(1)
I don't know why, but the settings in the normal project > properties > validation menu does not seem to be overriding the settings in the project > properties > PHP > validation. Which means you still going to see errors and warnings if you turned them on in PHP > validation, although they are turned off in the properties > validationAcrolith
M
33

Tried solution;

  1. Right click project
  2. Select properties
  3. Select validation
  4. Check Enable Project specific settings
  5. On the XML Validator row, click the '...' button
  6. Select Exclude Gruop
  7. Click Add rule
  8. Select 'Folder or file name'
  9. Click Next
  10. Select files or folder which are not validated.
  11. Click Finish
  12. Click OK
  13. Click OK

This solved my problem. Because eclipse validation gives error for generated GWT files.

Best regards.

Megagamete answered 13/3, 2011 at 9:21 Comment(3)
Yeah, mine as well. I'm using Zend Studio 8.0 with my Wordpress project. I really hate it when errors from /wp-admin and /wp-includes pollute the Problems tab. For PHP, you just exclude the folder in "HTML Syntax Validators for PHP" content.screencast.com/users/ardee.aram/folders/Jing/media/…Pave
Thanks for saving me several hours of waiting for Eclipse to validate my m2 target folders.Gwenny
That screenshot does not exists in my Eclipse. There is no "Validation" on the left, how to enable that?Geophysics
F
10

I came upon this question while looking for the same answer. I will list the steps I did here and hopefully it will help someone in the future.

I am using Eclipse 4.1 and I do the following to exclude validation for specific xml files. I am sure if you configure the different validators it will work for other files as well.

Go to Preferences -> Validation Find the Validator you wish to change and select settings (not all of the validators have settings, hopefully yours do).

In the settings you can add an Exclude Group where you can add a rule to specify to exclude the validator for specific extensions, folder or file name, project nature, facet or content type.

Figurative answered 6/12, 2009 at 9:46 Comment(0)
S
10

I have Eclipse for PHP Developers and I was dealing with the same issue.

In addition tot he excellent answers above, I have one more suggestion.

My first recommendation is not to use Aptana unless you actually want those validators (as they are nearly impossible to turn off from my experience).

Beyond that, go to File -> Properties -> Builders, and deselect "Validation" and "Script Builder" and "JavaScript Validator".

So far it's helped speed up some operations tremendously.

I also recommend disabling "Automatic Build". Because you're using PHP, the odds that you actually need it to build anything if you don't want validation is slim.

In the main menu, go to Project and uncheck "Build Automatically". You will want to build your project every now and then by right clicking on the project and selecting "Build Project".

All the above steps have helped me get the basic editor, which is exactly what I wanted.

Straley answered 11/12, 2009 at 13:24 Comment(2)
This is what solved my problem. I try a lot of combinations changes at Preferences\Validation and Preferences\JavaScript, but finally unselected "JavaScript Validator" at Project-> Properties\Builders and the problems was solvedBiron
This solved my problem, disabling the validation on GWT compiled filesEchinus
S
5

I used to exclude resources from validation via project specific Exclude Group (as the most answer here suggests). But in case anyone is still having problems with disabling validation for a specified folder in 2014 - just mark the folder resource as Derived:

Resource Properties dialog

This should disable validation for that folder.

If you are using EGIT you might also want to disable automatic inclusion of derived resources in .gitignore:

Git Projects Preferences dialog

Shaving answered 27/10, 2014 at 14:8 Comment(1)
It is end of 2017 and this approach does not seem to work in 100 %. bugs.eclipse.org/bugs/show_bug.cgi?id=323160 bugs.eclipse.org/bugs/show_bug.cgi?id=362790Shaving
S
4

It is not really possible to select a directory, at least under Windows.

After having pressed Preferences->Validation->Settings->Add Exclude Group->Add Rule->Folder or filename->Browse Folder->(selecting some directory)->[OK]

The "Browse for folder" dialog is being closed, with the "File or folder" field staying empty.

Sapp answered 24/7, 2011 at 15:12 Comment(0)
F
1

I had the same problem with the web app i'm developping. I ended up disabling automatic build, and building once a day (Project->Build automatically), that way i still get the benefits of code completion from libraries, while speeding up the program on older computers.

Fe answered 14/5, 2009 at 20:7 Comment(0)
P
0

I found in the project properties there is a Builders category. In the list of builders I had a JavaScript Builder. I deselected this builder and all my annoying javascript validation woes went away.

Prettify answered 1/7, 2010 at 17:43 Comment(0)
C
0

this worked for me: Properties > Builders section and unchecking the corresponding box. https://bugs.eclipse.org/bugs/show_bug.cgi?id=317833

seems to be a bug in some versions of eclipse.

Cabezon answered 1/9, 2010 at 13:5 Comment(0)
O
0

There are more gloabal validation parameters. You can suspend all validation (or only the ones you don't need) by going to:

Window > Preferences > Validation. 

Here, check the box "Suspend all validators".

Alternatively, uncheck the validators you don't need from the list below.
A full build will be requested which might take some time. But Eclipse will run a lot faster afterwards [But without validation of course]

http://www.flickr.com/photos/jesuspresley/5094048124/

Outsider answered 18/10, 2010 at 16:53 Comment(0)
F
0

Solution.

Go configure what's displayed in the Problems View like lothar proposed, create new custom filter and in "Scope" area choose "On working set". Now press the button right below this option to configure what working set would it be: in working set selection pop-up hit the "New" button and mark all your project files EXCEPT those you want to exclude from validation. You might want to save this working set under convenient name, like "No_Validation_Set".

Summary: 1) working set excluding problematic files. 2) custom Problems View filter to operate on this set.

Issues: when adding new files to project you need to update your working set, so they are validated too.

Finella answered 18/11, 2010 at 9:27 Comment(0)
I
0

When I excluded files from validation for the project, my setting didn't seem to be recognised until I restarted Eclipse and cleaned the project.

Indigested answered 15/3, 2011 at 10:15 Comment(2)
This should be a comment, not an attempted answer to the questionHexad
Bit too late to the party but - you should have used shortcut Alt+F5 and update (revalidate) the projectDistilled

© 2022 - 2024 — McMap. All rights reserved.