我尝试build.gradle
使用以下命令运行任务:
gradle footype
但是构建失败并显示了我要修复的这两个错误消息:
> Configure project :
The Task.leftShift(Closure) method has been deprecated and is scheduled to
be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
还有这个消息:
* What went wrong:
An exception occurred applying plugin request [id: 'java']
> Failed to apply plugin [class
'org.gradle.language.base.plugins.LifecycleBasePlugin']
> Declaring custom 'assemble' task when using the standard Gradle
lifecycle plugins is not allowed.
这是build.gradle
文件的代码:
plugins{
id "com.gradle.build-scan" version "1.10.2"
id "org.arquillian.spacelift" version "1.0.0-alpha-17"
id "java"
}
group 'k'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
task fooType {
doLast {
def foo = "bar"
println "$foo + foo = ${foo + "foo"}"
}
}
我搜索了其他帖子,他们似乎都提到了一个名为 clean() 的任务,它没有出现在我的代码中,所以我想知道问题出在哪里。
非常感谢您阅读这篇文章。