'依赖性'不能应用于'(groovy.lang.Closure)

时间:2015-07-31 10:14:17

标签: groovy cucumber build.gradle

我正在使用Groovy / Gradle和Cucumber框架。以下是版本

Groovy Version: 2.4.4

------------------------------------------------------------
Gradle 2.5
------------------------------------------------------------

Build time:   2015-07-08 07:38:37 UTC

Build number: none
Revision:     093765bccd3ee722ed5310583e5ed140688a8c2b

Groovy:       2.3.10
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.7.0_17 (Oracle Corporation 23.7-b01)
OS:           Windows 8 6.2 amd64

当我尝试运行以下

时出现此错误
$ gradle clean idea

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Documents and Settings\Sudheerah\Documents\Sudheera\KBase\APDM\APIAutomation\build.gradle' line: 76

* What went wrong:
A problem occurred evaluating root project 'APIAutomation'.
> Could not find method groovy() for arguments [org.codehaus.groovy:groovy-all:2.4.4] on root project 'APIAutomation'.

* 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: 35.237 secs

以下是build.gradle文件错误行。

enter image description here

堆栈跟踪

Caused by: org.gradle.api.internal.MissingMethodException: Could not find method groovy() for arguments [org.codehaus.groovy:groovy-all:2.4.4] on root project 'APIAutomation'.
        at org.gradle.api.internal.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:68)

1 个答案:

答案 0 :(得分:1)

假设您已经应用了groovy插件,则需要将groovy依赖项更改为编译依赖项。

groovy依赖是设置groovy插件的旧方法