IntelliJ在复制任务中将导入添加到Gradle

Str*_*der 22 intellij-idea gradle

我在IntelliJ 2016.1中有一个非常恼人和无法解释的行为:

如果在构建文件中使用Gradle复制任务,IntelliJ会在此文件的任何编辑中添加此导入:

com.sun.org.apache.xalan.internal.xsltc.compiler.Copy
Run Code Online (Sandbox Code Playgroud)

这当然没有必要,因为这个任务是内置的Gradle.执行时会导致此错误:

无法创建"复制"类型的任务,因为它未实现"任务"界面.

复制任务只是这样一个简单的:

task copyNodeModules(type: Copy) {
    group="_webapp"
    from('./src/main/ts/node_modules') {
        include '**/*'
        exclude '**/lite-server'
        exclude '**/json-server'
        exclude '**/.bin'
    }
    into project.buildDir.path + '/resources/someFolder'
}
Run Code Online (Sandbox Code Playgroud)

Luk*_*ane 17

即将 Settings -> Auto Import -> Exclude from auto import and completion

'com.sun.org.apache.xalan.internal.xsltc.compiler'为我添加 固定.