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
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Dependency configuration


Java has no real support for working with versioned libraries as dependencies. We cannot express in Java whether our class depends on lib-1.0.jar or lib- 2.0.jar, for example. There are some open source solutions that deal with dependencies and allow us to express whether our Java code depends on lib- 1.0.jar or lib-2.0.jar. The most popular are Maven and Apache Ivy. Maven is a complete build tool and has a mechanism for dependency management. Ivy is only about dependency management.

Both tools support repositories where versioned libraries are stored together with metadata about these libraries. A library can have dependencies on other libraries and is described in the metadata of the library. The metadata is described in the descriptor XML files. Ivy fully supports Maven descriptor files and repositories; it also adds some extra functionality. Therefore with Ivy, you get what you would with Maven, and then some more. This is why Gradle uses the Ivy API under the...