X

Geertjan's Blog

  • March 11, 2015

Ignored Files in NetBeans IDE

Geertjan Wielenga
Product Manager

In the Options window, within Miscellaneous | Files, there's this cryptic text field:

How to understand it and how to, for example, enable all XML files to be ignored, i.e., not shown in the Projects window and Files window?

The above is a regular expression, here is an explanation of the characters you see being used above:

Character Description
| Or.
^ Matches all file or directory names beginning with the subsequent characters.
$ Matches all file or directory names ending with the preceding characters.
\ Escape character. Necessary if you want to match to a period (.) or other special character.         
.* Wildcard.

For example, if you want to ignore all files with the .bak extension, add this:

\.bak$

That means you now have this line, with the addition in bold below:

^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|\.bak$|~$|^\.(?!(htaccess|git.+|hgignore)$).*$ 

 Similarly, if you don't want to see XML files, change bak to XML, as shown below:

^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|\.xml$|~$|^\.(?!(htaccess|git.+|hgignore)$).*$ 

However, notice what happens in the Projects window and Files window for Maven projects when XML files are ignored, via the above setting.

This is the default situation, i.e., everything is shown exactly as it is when you make no changes to the ignored files definition: 

Here, however, XML files have been excluded:

What you see is that the "Project Files" node is excluded from the ignored files definition. While all the XML files are ignored, i.e., hidden, throughout the project, both in the Projects window and in the Files window, the Project Files node remains showing the XML files. Not sure whether to see this as a bug or not. 

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.