Adding Guava library and custom task in Gradle

Report a typo

Imagine you are working on a Java project that uses Gradle build tool. You want to include the Guava library version 23.0 in your project, and also want to add a custom task called 'sayHello', which simply prints 'Hello, Gradle!' on the console. Fill in the blanks in the given build.gradle file to achieve this task.

Fill in the gaps with the relevant elements
 plugin: 'java'

 {
    jcenter()
}

 {
    compile 'com.google.guava:guava:23.0'
}

 sayHello {
    doLast {
        printf 'Hello, Gradle!'
    }
}
importsresourcesprocessapplytaskdependenciesinvokerepositories
___

Create a free account to access the full topic