Build Automation Gradle Interview Questions

What does the command ./gradlew do when it is run from within a Gradle project’s directory?
– It runs the Gradle Wrapper.

What does a smoke test do?
– Tests large-scale, basic things like whether or not the application runs.

What can you use to take advantage of pre-built Gradle tasks created by the Gradle community?
– Gradle plugins

Which of the following are the kinds of tasks build automation tools usually handle? (Choose all that apply)

– Compiling code
– Packaging the app for deployment
– Dependency management

What does Gradle do?
– Build Automation

Which type of testing tests the smallest amount of code in a single test?
– Unit test

Which of the following does declaring a dependency between two tasks in Gradle do? (Choose all that apply)

– It ensures that when a task is called, the task that it depends on also runs.
– It ensures that if both tasks are run, the task which is a dependency will always run before the one that depends on it.
What software does Gradle require to be installed on a system before it can run?
– Java JDK 7 or higher

What does build automation do?
– It automates the process of processing source code in preparation for deployment.

How to install and run the Gradle Wrapper

To install and run the Gradle Wrapper

mkdir my-project
cd my-project
gradle wrapper
./gradlew build


[root@aryan-34252e5f2 ~]# mkdir my-project
[root@aryan-34252e5f2 ~]# cd my-project
[root@aryan-34252e5f2 my-project]# gradle wrapper
Starting a Gradle Daemon (subsequent builds will be faster)

1 actionable task: 1 executed
[root@aryan-34252e5f2 my-project]# ./gradlew build

> Task :buildEnvironment

Root project

No dependencies

A web-based, searchable dependency report is available by adding the –scan option.

1 actionable task: 1 executed
[root@aryan-34252e5f2 my-project]#


How to install Gradle

To install Gradle in CentOS

get -O ~/
sudo yum -y install unzip java-1.8.0-openjdk
sudo mkdir /opt/gradle
sudo unzip -d /opt/gradle/ ~/
sudo vi /etc/profile.d/

Open Vi Editor and add this line

export PATH=$PATH:/opt/gradle/gradle-4.7/bin

Then set permissions on

do chmod 755 /etc/profile.d/

log out of the server and logging back in:

gradle --version