Book Image

Gradle Effective Implementations Guide - Second Edition

By : Hubert Klein Ikkink
Book Image

Gradle Effective Implementations Guide - Second Edition

By: Hubert Klein Ikkink

Overview of this book

Gradle is a project automation tool that has a wide range of applications. The basic aim of Gradle is to automate a wide variety of tasks performed by software developers, including compiling computer source code to binary code, packaging binary codes, running tests, deploying applications to production systems, and creating documentation. The book will start with the fundamentals of Gradle and introduce you to the tools that will be used in further chapters. You will learn to create and work with Gradle scripts and then see how to use Gradle to build your Java Projects. While building Java application, you will find out about other important topics such as dependency management, publishing artifacts, and integrating the application with other JVM languages such as Scala and Groovy. By the end of this book, you will be able to use Gradle in your daily development. Writing tasks, applying plugins, and creating build logic will be your second nature.
Table of Contents (18 chapters)
Gradle Effective Implementations Guide - Second Edition
About the Author
About the Reviewer

Using Jenkins

One of the most popular open source continuous integration tools is Jenkins. The good news is that Jenkins has support for Gradle via the Gradle plugin. Let's see how to use the plugin to add our little Java project to Jenkins.

To install Jenkins on our computer, we must first download the installation files from the Jenkins website. A native installer is available for Mac OS X, Windows, and Linux. We can simply run the installer software to install Jenkins on our computer. We can also download a WAR file and deploy it to a Java web container to install Jenkins. The WAR file is also a Java executable archive. This means that we can simply run the WAR file with the java -jar command to execute Jenkins.

Adding the Gradle plugin

  1. First, we must install the Gradle plugin in Jenkins.

  2. We will launch a web browser and access http://localhost:8080 . From the Jenkins main page, we will select the Manage Jenkins link, which takes us to the appropriate page, as shown in the following image...