I started learning Gradle (Java + Gradle) and created this very basic - build.gralde - file.
task testone(type: Test) {
println ("Started TestSetUp")
}
In Console when ran command -> gradlew testone -- intellij is throwing error:
> Configure project :
Started TestSetUp
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':testone'.
I think i can help you with that, By changing the type from Test to Copy, this will build perfectly, Copy is a defined type in gradle and running gradle testone -q
will show your output.
I think the problem is with your defined type, by declaring the type as Test
you need to add more configuration for this, because the error i got when i tried to register the task like
tasks.register testone(type: Test) {
println ("Started TestSetUp")
}
was Could not find method testone() for arguments [{type=class org.gradle.api.tasks.testing.Test}
so your issue is with the Test type, i spose your missing some extra configuration.
In "build.gradle", after adding java plugin, the task ran successfully,
though not sure the exact underlying details about how this plugin resolved this!
plugins {
id 'java'
}
task testone(type: Test) {
println ("Task of type Test Success")
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.