Chapter 6. Testing, Building, and Publishing Artifacts

An important part of developing software is writing tests for our code. In this chapter, we will learn how we can run our test code as part of the build process. Gradle supports both JUnit and TestNG testing frameworks. We can even run tests in parallel to shorten the time of the build, resulting in quick builds.

We will also learn how to run a Java application as part of a Gradle build. We can use the application plugin to automatically execute a Java application as part of the build.

After we have written and tested our code, it is time to publish the code so others can use it. We will build a package and deploy our code to a company repository or any other repository.

Testing

Gradle has built-in ...

The best content for your career. Discover unlimited learning
on demand for around $1/day.