Java Reference
In-Depth Information
Figure 4.13 The Paths window is used to specify which directories in
your modules contain Java source for production, Java source for
testing purposes, and artifacts that should be excluded.
button. Content root folders can be removed easily by clicking the cross icon to
the right of the content root item in the panel and confirming its removal.
Each content root folder contains folder paths under three important desig-
nations:
Source folders
contain Java source files.
■
Test source folders
contain Java source files related to testing only.
■
Excluded folders
are folders that
IDEA
should ignore when searching, com-
piling, and performing other similar actions.
■
Understanding source folders
When you designate a folder as a source path, you're telling
IDEA
that this folder
and its subfolders contain Java source code that should be compiled as part of the
build process. The top of this folder is considered the root of a package hierarchy;
.java
files in it are considered part of the default package, whereas subfolders
designate a standard Java package structure.
Test source folders are singled out for special treatment so you can keep code
used for testing (such as unit tests) separate from the production code. This
makes it easy to package your application for distribution free from any testing-
related code. We'll look further into
IDEA
's support for unit testing in chapter 7.