IntelliJ IDEA 13: new Scala SBT project hasn't src directory structure generated

aleung picture aleung · May 18, 2014 · Viewed 12.7k times · Source

I followed the getting start video on Jetbrains website to setup IntelliJ IDEA 13.1 Community Edition to work with Scala. Scala plugin v0.36.431 had been installed. While I created a new Scala SBT project with wizard, there was no src/ directory structure generated in the project. Only two sbt files were generated:

scala-course/
├── build.sbt
└── project
    └── plugins.sbt

From the video and other document I know that there should be a src/ directory structure, including src/main/scala, src/test/scala, etc. sbt uses the same directory structure as Maven for source files by default.

I can create those folders manually and mark it as source root. However it is trivial. So my question is: Why IntelliJ IDEA new project wizard doesn't generate the directory structure as said in document? Was I doing something wrong? I checked the preferences and couldn't find anything that seems related.

Answer

lpiepiora picture lpiepiora · May 18, 2014

Normally it should create these folders automatically. It may take a while though - it takes couple of seconds in my case.

When creating project make sure you have selected Scala -> SBT, then proceed with the wizard.

Once the Finish is clicked, the project will be loaded. This part takes couple of seconds, and I can see no src/main/scala nor src/test/scala generated until it's done. Observe the bottom of the screen to see when it's done.

Loading Process

Once the process is finished, you'll see the folders.

Loaded Done

If that's not the case, check the settings. You should have the Create directories for empty content roots automatically checked. You may want to check Use auto-import to automatically propagate changes in the build.sbt.

Settings

After changing the settings (if the change is required) you may need to refresh the project, as seen in picture below.

Refresh Settings