For reasons beyond my control, many of my project directories must contain several symbolic links to directories containing huge numbers of files (potentially hundreds of thousands) on a network file system. These are located parallel to the root pom.xml
.
When IntelliJ attempts to index these directories, it freezes up (I expect it would finish eventually). Often I can mark these directories as excluded so IntelliJ will not index them. However, these directories are sometimes created after initial project import. If IntelliJ catches them before I can mark them as excluded, it freezes. Worse, when I restart and attempt to open the project, it immediately freezes again.
How can I mark that these directories should be excluded without actually opening the project in IntelliJ IDEA?
In the Settings/Preferences dialog Ctrl+Alt+S , click Directories . In the Exclude files field, type the masks that define the names of files and folders to be excluded, for example, *.
Excludes Use this page to specify files and directories within your project that should not be passed to the compiler. In this field, the path to a file or directory to be excluded from compilation is shown. For a directory: select this option to exclude from compilation all the corresponding subdirectories.
press ctrl + shift + a , and in the input box that appears type excludes , and select the first item that appears.
In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Build, Execution, Deployment| Compiler | Excludes.
You can edit the project file directly to exclude these directories. Find the .iml
file for your project. Add excludeFolder
elements under the content
element like this:
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
<!-- other things will be here -->
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/directoryToExclude" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<!-- etc -->
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With