IDEA在树中显示两次项目

Sim*_*oño 11 intellij-idea gradle kotlin

我和Gradle有一个Kotlin项目,有两个孩子.每当我尝试在IDEA中打开它时,其中一个孩子会在树上出现两次.

截图

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

这是我的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()
    }
} 
Run Code Online (Sandbox Code Playgroud)

gradle.settings文件:

include ':grpstd', ':grpc'
Run Code Online (Sandbox Code Playgroud)

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"
}
Run Code Online (Sandbox Code Playgroud)

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"
}
Run Code Online (Sandbox Code Playgroud)

为什么该项目会被展示两次?我该怎样预防呢?

ice*_*000 1

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