I have a SBT project in Intellij 15.0.2 for scala only programming.
For some reason, the project keeps creating the following folders in my project:
I have attempted to remove them by unchecking them as "Sources" or "Tests" in my Project Structure and then deleting the folders. But they are immediately re-created by Intellij ...
src/main/java places your code that use for real production. src/test/java places your test use case code, like junit test. These codes would be executed when doing maven package things.
From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Modules. Select the necessary module and open the Sources tab. next to Source Folders or Test Source Folders. Specify the package prefix and click OK.
out is the default name IntelliJ IDEA uses for the compiler output directory. When the project is configured via a build tool like Gradle or Maven, IDEA will change the compile output directory to match that used by those tools, such as target or build .
Sources Root - this is where your actual project code goes - typically in src/main/scala (though you can change that, or add extra source directories in your build). Directories nested below this level should be packages. Intellij needs to know these are sources so it can highlight them, check them for errors, etc.
You can disable this while creating/importing sbt project (there is a suitable checkbox).
If project is already created, you can go to
Settings |> Build, Execution, Deployment |> Build Tools |> SBT
and uncheck Create directores for empty content roots automatically
This option is kind of usefull if you are starting a new project as it will create directories for you, but after this I suggest to disable this option and keep only directories you want, otherways directories will be generated each time you build/refresh project.
See picture:
Seems like this option disappeared from Idea interface. If you have an old project and it is enabled there, go to .idea/sbt.xml
and get rid of
<option name="createEmptyContentRootDirectories" value="true" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With