Gradle Build Error Evaluating Root Project for org/gradle/in



我一直在使用遗留项目的构建脚本,我在使用 Gradle 2.13 时遇到以下错误。

myhost jthoms$ gradle clean build
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.13/userguide/gradle_daemon.html.
FAILURE: Build failed with an exception.
* Where:
Build file '/<my-project>/build.gradle' line: 10
* What went wrong:
A problem occurred evaluating root project 'com.mycompany.myorg.myproject'.
> org/gradle/internal/metaobject/MethodMixIn
* 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: 3.494 secs

我的build.gradle文件如下所示:

buildscript {
repositories {
maven { url 'http://<my-nexus-repo>/' }
}
dependencies {
classpath 'com.bmuschko:gradle-clover-plugin:2.1.2'
}
}
apply plugin: 'com.bmuschko.clover'
// more build stuff below irrelevant to error line.

我的构建失败了,那么如何修复此错误?

我解决了这个错误,但我找不到与错误输出中提到的类相关的任何内容,所以我想我会在这里分享我的发现。

我发现这个线程有类似的错误。在线程中,@bmuschko建议升级到较新版本的 Gradle。对我来说,从 Gradle 版本 2.13 升级到 3.5.1 就像一个魅力。

相关内容

最新更新