Search code examples
intellij-ideaantbuild.xml

Idea highlighting tags in build.xml as not allowed


My IDE (Idea) says: Element 'property' not allowed here.

And some other elements not allowed too. But project building successfully. How can i fix this?

Pic1


Solution

  • It looks like IDEA is not recognizing the file as an Ant build file. The fact that the <project> tag is in red indicates that is, pardon the pun, the root of the problem. Try the following:

    1. Got to File > Invalidate Caches / Restart (or Application > Invalidate Caches / Restart on Mac)
    2. Click the Invalidate and Restart button on the "Invalidate Caches" dialog
    3. Let IDEA restart and then re-index the project.

    Another thing to check, although a long shot, is that the Ant Support plugin is enabled in File > Settings > Plugins.

    If that does not solve the issue, can you please put your cursor on the <project> element and indicate what the error is for that element.