The general solution that I found is a trick that only works for directories that the user can exclude from the netbeans project tree that follows the following algorithm:
create a link in the directory that generates the syntax error in a place outside the project.
ignore the directory that generates the error.
add the link created to the included routes of the project configuration.
Solution in Linux
Suppose that our project directory is:
/var/www/html/stackoverflow
The first step is to create a directory link outside the project, for which we can use something like this:
ln -s /var/www/html/stackoverflow/vendor ~/proyectos/otros/vendor-stackoverflow
The second step is to ignore the directory that generates the syntax error, by right clicking on the project and selecting the option Properties
, then go to the section Ignored Folders
and add the mentioned file.
This will remove the directory from the netbeans project tree as well as the error notification, but it will also delete the auto-completion corresponding to the code analysis to this directory, so to solve this emerging problem: Finally we turn to the section Include Path
of the properties of the project and add in the tab Private
the symbolic link that we have created previously
The result will be the absence of the annoying red notifier and the permanence of the self-completion of our bookstores, something like this:
Solution in Windows {Versions greater than Vista}
In windows only differs from the first step since the way to create links is somewhat different, in this case the command will be something like this:
mklink /j c:\xampp\stackoverflow\vendor c:\users\proyecto\vendor-stackoverflow
Assuming clearly that our project is stored in c:\xampp\stackoverflow
.
From here on you should only follow the steps mentioned and everything should work correctly.