我一直在使用遗留项目的构建脚本,我在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.
我的构建失败,那么如何修复此错误?
我解决了这个错误,但是我无法找到与错误输出中提到的类相关的任何内容,所以我想我会在这里分享我的发现。
答案 0 :(得分:0)
我发现了this thread类似的错误。在该主题中,@ bmuschko建议升级到较新版本的Gradle。对我来说,从Gradle版本2.13升级到3.5.1就像一个魅力。