IDEA在树中显示一个项目两次

我有一个Gradle的Kotlin项目,有两个孩子。 每当我尝试在IDEA中打开它时,其中一个孩子会在树中显示两次。

截图

在树中,你可以看到两个顶层的项目,grpc和grp。 问题是grpc(从顶层)和grpc是grp的子项目是同一个项目。

这里是我的Gradle构建文件:

父级gradle.build:

buildscript { ext.kotlin_version = '1.0.1' repositories { jcenter() mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } allprojects { repositories { jcenter() mavenCentral() } } 

gradle.settings文件:

 include ':grpstd', ':grpc' 

grpc gradle.build:

 apply plugin: 'antlr' apply plugin: 'application' apply plugin: 'kotlin' mainClassName = 'sron.grpc.MainKt' compileKotlin.dependsOn generateGrammarSource generateGrammarSource { arguments += ['-package', 'sron.grpc.compiler.internal'] } dependencies { antlr 'org.antlr:antlr4:4.5.2-1' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile 'commons-cli:commons-cli:1.3.1' compile 'org.ow2.asm:asm:5.0.4' compile project(':grpstd') testCompile 'junit:junit:4.12' testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" } 

grpstd gradle.build:

 apply plugin: 'kotlin' dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" testCompile 'junit:junit:4.12' testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" } 

为什么这个项目被显示两次? 我怎样才能防止它?

打开您的project structure对话框(您可以使用Ctrl+Alt+Shift+S ),转到Modules部分,检查是否有重复的模块在那里定义。 如果有的话,删除不必要的。