Configuring Content Roots
Any project contains at least one content root created together with the project. You can create additional content roots as well as remove the unnecessary ones.
Create a content root
Open the Project Structure settings.
In the Projects pane of the Project Structure page, click the project you want to configure content roots for.
In the Content roots of the Project Structure page, click the Add Content Root button .
In the dialog that opens, locate the desired directory and click OK.
Remove a content root
Specifying folder categories
Here is how you assign a folder to a different category. In a similar way, you can assign a folder to any other category. This can be done both in the Project tool window and on the Project Structure page of the Settings/Preferences dialog.
To assign a category to a folder in the Project tool window, follow these steps
Open the Project tool window (for example ).
Select the folder that you want to assign to a certain category.
In the context menu, point to Mark Directory As and select the desired category.
In a similar way you can change the folder category at a later time. (Just select a different category from the context menu.)
To cancel the folder association with its current category (that is to make a folder an "ordinary" folder ), select Unmark as <current_category> Root. (for example Unmark as Test Sources Root).
To assign a category to a folder in the Project Structure page, follow these steps
Open Project Structure page of the Settings/Preferences dialog.
Select the folder you want to assign a category to.
Click the category button, for example, .
Excluding files and folders by name patterns
You can make files and folders excluded by specifying the name patterns. Use the Exclude files field to specify the patterns.