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.
-
1I haven't found a way around this either. IMHO it's a bug in Eclipse. – Matt Solnit Dec 13 '08 at 01:02
-
Is it possible to point it to a DTD or XML Schema which accepts anything? To fool it. I'm also bugged by this bug. – Jan 26 '09 at 02:19
-
4+1 just for "I have an anal-retentive yearning for a warning-free Problems tab." Possibly the best SO quote of all time. – cobaltduck Jul 18 '14 at 11:53
7 Answers
The simplest is to supply a minimal DTD to shut it up.
<!DOCTYPE project>
for ant files

- 8,425
- 4
- 40
- 55

- 9,459
- 4
- 40
- 32
-
14Indeed, so the start of your build.xml looks like: `
` I had to close + reopen the tab for the warning to go away... – Oct 01 '09 at 09:35 -
2Sorry if this is a stupid question, but ANT dont have a DTD file that we can point to real validate the XML? Cheers! – rafa.ferreira May 14 '10 at 02:32
-
5None that I know of. Besides Ant extensibility makes it impossible to get a complete one. – David Pierre May 19 '10 at 15:01
-
-
1@Nicholas White - you can also just right click on the project and choose Validate, that should make the warning go away once you make the change – Green Day Jun 22 '12 at 22:11
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.
- Select the Validation category in the left pane.
- Find the Validator named "XML Validator" (in the right pane) and click its ellipses (...) button.
- In the following dialogue, select the "Exclude Group" and click "Add Rule...".
- On the first page of the New Filter Rule Wizard, select the Content Type option and click Next>.
- Finally, on the Content Type drop down, select "Ant Buildfile".
- Click Finish and a couple of OKs and that should take care of existing and future Ant Build file validation warnings.

- 271
- 3
- 2
Even though this thread is a little older, somebody might find this interesting:
http://www.cs.hs-rm.de/~knauf/KomponentenArchitekturen2008/jsfunit/index.html
Go to Project Properties -> Validation and follow the screen shots on that page. Should be easy even if you don't speak German. ;-)
This solution worked perfectly for me. Cheers!
You can delete it, and restore it to avoid the warning. It is a bug, obviously.

- 30,738
- 21
- 105
- 131

- 41
- 1
I see an option to disable this in newer versions of Eclipse. It is under: Window, Preferences, XML, XML Files, Validation then change the drop-down "Indicate when no grammar is specified:" from "Warn" to "Ignore"..

- 4,642
- 8
- 43
- 75
In fact, as damoco says, this seems to be a bug in Eclipse. If I delete (copy elsewhere) the file from windows, refresh eclipse, and then restore the file, and refresh again, the warning goes away.
I'm using Eclipse Galileo build 20090621-0832.

- 60,889
- 18
- 128
- 171