无法应用插件[class' org.gradle.api.plugins.scala.ScalaBasePlugin']:Gradle v2.13

时间:2017-06-29 21:43:02

标签: java scala gradle build

尝试使用 gradle 2.13 构建我的项目。

获取错误:

MUSGM186035-835:c gm$ gradle build
Version suffix : -6

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/gm/IdeaProjects/repo/a/b/c/build.gradle' line: 2

* What went wrong:
A problem occurred evaluating project ':b:c:QGInitiator'.
> Failed to apply plugin [class 'org.gradle.api.plugins.scala.ScalaBasePlugin']
> A dependency must not be empty

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or 
--debug option to get more log output.

BUILD FAILED

Total time: 8.397 secs

我的build.gradle文件看起来像

apply plugin: 'java'
apply plugin:'scala'//Line with error

ourceCompatibility = 1.8

repositories {
   mavenCentral()
}

dependencies {
   compile "org.scala-lang:scala-library:2.11.1"
}

此项目是另一个包含其他gradle文件的项目的一部分。但我并没有欺负父项目。不确定我的依赖是怎么回事。

堆栈跟踪:

   Caused by: org.gradle.api.InvalidUserDataException: A dependency must not be empty
at org.gradle.api.internal.tasks.DefaultTaskDependency.addValue(DefaultTaskDependency.java:122)
at org.gradle.api.internal.tasks.DefaultTaskDependency.add(DefaultTaskDependency.java:115)
at org.gradle.api.internal.AbstractTask$11.run(AbstractTask.java:323)
at org.gradle.api.internal.tasks.TaskMutator.mutate(TaskMutator.java:37)
at org.gradle.api.internal.AbstractTask.dependsOn(AbstractTask.java:321)
at org.gradle.plugins.ide.idea.IdeaPlugin$_configureForScalaPlugin_closure8.doCall(IdeaPlugin.groovy:229)
at org.gradle.plugins.ide.idea.IdeaPlugin$_configureForScalaPlugin_closure8.call(IdeaPlugin.groovy)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
at org.gradle.internal.Actions$FilteredAction.execute(Actions.java:205)
at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:39)
at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:165)
at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:159)
at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:142)

1 个答案:

答案 0 :(得分:0)

尝试将idea插件应用于root插件。我不确定发生了什么,但这应该可以解决问题。