如何阻止Intellij创建src / main / java和src / main / scala-x文件夹? [英] How to stop Intellij from creating src/main/java and src/main/scala-x folders?
问题描述
我在Intellij 15.0.2中有一个仅用于scala编程的SBT项目。
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:
- src / main / java
- src / main / scala-2.10
- src / main / scala-2.11
- src / test / java
- src / test / scala-2.10
- src / test / scala-2.11
- src/main/java
- src/main/scala-2.10
- src/main/scala-2.11
- src/test/java
- src/test/scala-2.10
- src/test/scala-2.11
我试图通过取消选中它们作为来源或在我的项目结构中测试,然后删除文件夹。但它们会立即由Intellij重新创建...
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 ...
推荐答案
您可以在创建/导入sbt项目时禁用它(有一个合适的复选框)。
You can disable this while creating/importing sbt project (there is a suitable checkbox).
如果项目已经创建,你可以去
If project is already created, you can go to
设置|>构建,执行,部署|>构建工具|> SBT
Settings |> Build, Execution, Deployment |> Build Tools |> SBT
并取消选中创建directores对于空内容根自动
如果您要启动一个新项目,因为它将为您创建目录,但此后该选项非常有用我建议禁用此选项并仅保留您想要的目录,每次构建/刷新项目时都会生成其他目录。
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.
参见图片:
似乎这个选项从Idea界面消失了。如果你有一个旧项目,并在那里启用它,请转到 .idea / sbt.xml
并摆脱
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" />
这篇关于如何阻止Intellij创建src / main / java和src / main / scala-x文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!