How to work with a module?

I asked this question on gitter, but as it might be too involved for that forum, I’ll re-ask it here.

Someone mentioned to me a while back that I should use modules in IntelliJ to seperate different unrelated pieces of code in the same project. Can someone tell me what that is? Is it a maven concept, or a java concept, or a scala concept, or an IntelliJ concept?
I tried simply in IntelliJ to create a “New module” called grader in an existing project. Here is what it did to my directory structure. It created a grader directory parallel to project, src, and target. Do I now have an one empty module, and all my old code in no module? Do I need to create a seperate module for my old code and move the old code into it?

Screenshot 2020-06-15 at 09.57.12

If I try to create a new scala class (file) in the module, I don’t see any such option in the pop up menu.

If you define sub-projects in SBT, they will become modules in IntelliJ.

1 Like

I would suggest you to use your IDE just as a tool to edit code, but not as a tool to manage your project, that is the work of a build tool.

SBT, Maven & Gradle all support multi-module projects. Mill, AFAIK, only supports multi-module projects.

I have a related question. What is Scala’s interaction with Java 9 modules? How can I, or can I, use Java 9 modules in a Scala project?