简体   繁体   中英

.ant-targets-build.xml puts eclipse project into error

I am using the most excellent ant/bin/complete-ant-cmd.pl for bash completion of ant targets and it caches its results in a file called.ant-targets-build.xml. The problem is, in my eclipse project, eclipse is a little overaggressive validating everything it believes is actually XML (which.ant-targets-build.xml isn't...its just the raw targets separated by newlines).

How do I get eclipse to relax its restrictions and treat.ant-targets-build.xml as NOT an xml file...just text or something.

Project->Properties

  • Check Enable project specific settings .
  • Click ellipsis next to XML Validator

项目属性

  • Click on Exclude Group
  • Click on Add Rule

验证规则

Follow wizard and create File exclusion.

One of the most annoying "features" of this dialog is that you cannot edit existing rules. If you make a mistake you will need to delete that rule and recreate it from scratch.

BTW, in your case it may be preferable to create a global workspace rule ( I usually like to keep special cases with the project ).

In any case after you finished with rule creation, right-click on a project with warnings and choose Validate . This will clear these warnings

If you decided to edit validation preferences in project and not in workspace, then add project-name/.setting/org.eclipse.wst.validation.prefs file to source control.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM