2.1.2. Define the Workspace

As a next step, we need to create one or several modules. A module is the container for source and class root directories and usually represents a Maven module or an Eclipse / IntelliJ project. We will start creating a single module, and refine the workspace later.

A module is created by selecting "File""New" and selecting the wizard entry "Manual Java Module". Define the module's name and optionally provide a description.

As a next step, we let Sonargraph search for directories containing source and class files. Right-click on the created module in the Navigation view. Select the context menu entry "Manage Java Source/Class Root Directories/Archives..." and specify the root directory of the Apache Cassandra project on your disk.

Start the detection and wait until it completes. Now you can move the found directories via drag&drop from the right to the left. We omit directories containing examples or test code.

Detection of Java Root Directories
Figure 2.2. Root Directories Dialog

The workspace configuration can be examined on the Workspace view. We can see that it is probably best to create additional modules "thrift" and "stress" using the same approach as previously. Now you can use drag&drop in the Workspace view to move directories from the "default" module and rename "default" to "main" using either the context menu or the F2 shortcut.

Workspace View
Figure 2.3. Workspace View


The order of the root directories matters: In case there are classes with the same fully qualified names, the first one found wins. You can change the order of root directories of manual Java modules within the Workspace view using drag&drop.