Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable DTD warning for Ant scripts in Eclipse?

I'm using Eclipse Ganymede. Everything works fine, but I have an anal-retentive yearning for a warning-free Problems tab. Right now it (correctly) complains about my Ant scripts: "No grammar constraints (DTD or XML schema) detected for the document." Is there any way to turn that off for just those files? Ideally I'd like it to still warn me if my other schema-constrained files were missing the schema declarations.

like image 344
Brian Deacon Avatar asked Dec 12 '08 18:12

Brian Deacon


Video Answer


2 Answers

The simplest is to supply a minimal DTD to shut it up.

<!DOCTYPE project> 

for ant files

like image 109
David Pierre Avatar answered Sep 30 '22 16:09

David Pierre


Being with Brian on the "anal-retentive yearning for a warning-free Problems tab", I finally decided to get serious about solving this. Thanks to Martin's leading, it looks like a done deal.

However, instead of Project -> Properties, it's solvable globally via Windows -> Preferences.

  1. Select the Validation category in the left pane.
  2. Find the Validator named "XML Validator" (in the right pane) and click its ellipses (...) button.
  3. In the following dialogue, select the "Exclude Group" and click "Add Rule...".
  4. On the first page of the New Filter Rule Wizard, select the Content Type option and click Next>.
  5. Finally, on the Content Type drop down, select "Ant Buildfile".
  6. Click Finish and a couple of OKs and that should take care of existing and future Ant Build file validation warnings.
like image 31
BruceR Avatar answered Sep 30 '22 16:09

BruceR