Gradle 4

This course is currently not scheduled on the open calendar, but can be organized on request.

Number of days

2 day(s)

Audience

Java developers who would like to learn how to leverage Gradle to empower their builds

Prerequisites

Knowledge of Java and Java EE libraries is recommended

Objectives

Discover how great Gradle is for creating Java builds

Methods

Classroom training with hands-on exercises

Description

Gradle is quickly becoming the defacto build tool for Java projects. While most developers still use Maven, more and more projects such as Android, Spring and Hibernate are using Gradle to simplify and empower their builds. If you want to know why Gradle is such a excellent build option, this course is for you!

During the course you will learn how to install Gradle and how to create Gradle build scripts. You will see how to leverage the power of plugins to simplify your development cycle. You will be able to apply Gradle on simple as well as multi-module project builds. The course will also show you how Gradle handles dependencies, reporting and code coverage.

The course includes several advanced topics that demonstrate the flexibility of Gradle, through the Groovy DSL. While you are not required to learn Groovy to use Gradle, it will help in understanding build scripts.

The exercises after each chapter will give you experience by applying what you learned. At the end of the course, you will be able to use Gradle effectively in your Java projects and know why this build tool is so exciting!

Contents

  • Java Builds with Gradle
    • Goal
    • Agenda
  • Getting Started
    • What is Gradle?
    • Prerequisites
    • Manual Installation
    • Installing Using Package Managers
    • No Installation Using the Gradle Wrapper
    • The Command Line Interface
    • Creating a Gradle Build Script
    • The Gradle Daemon
    • The Gradle Wrapper
    • Exercise: Getting Started
  • Building Java Projects
    • Using Gradle to Build Java Projects
    • Creating a Java Project
    • Compiling and Building
    • Building and Cleaning
    • Gradle Plugins
    • Unit Testing with Gradle
    • The Test Report
    • Testing and Building
    • Running the App from Gradle
    • Building the Distribution Archive
    • Generating IDE Project Files
    • Exercise: Building Java Projects
  • Building Web Applications
    • Creating a Java Web Project
    • Building the WAR File
    • Running Web Applications
    • Configuring Web Applications
    • Exercise: Building Web Applications
  • Managing Dependencies
    • Project Dependencies
    • External Libraries
    • Transitive Dependencies
    • Configuring Dependencies
    • Repositories
    • Exercise: Managing Dependencies
  • Learning Groovy
    • Using Gradle Build Scripts
    • What is Groovy?
    • Running Groovy
    • Variables
    • Strings
    • Regular Expressions
    • Closures
    • Data Structures
    • Methods
    • Calling Methods
    • Variable Arguments & Closure Parameters
    • Classes & Constructors
    • Properties
    • Instance Methods
    • Groovy Summary
    • Building Groovy Projects
    • Exercise: Learning Groovy
  • Understanding Build Scripts
    • Applying Plugins
    • Object Oriented Gradle
    • Gradle Build Phases
    • Project Methods
    • Project Properties
    • Extra Properties
    • Tasks
    • Attaching Actions to Tasks
    • Task Flow Control
    • Creating Tasks Dynamically
    • Setting Default Tasks
    • Enhanced Tasks
    • Creating Task Types
    • Exercise: Understanding Build Scripts
  • Multi-Project Builds
    • Building Enterprise Projects
    • Settings
    • Organizing Build Logic
    • Applying Build Logic to Sub-Projects
    • Dependency on Sub-Projects
    • Exercise: Multi-Project Builds
  • Migrating Maven Projects
    • From Maven to Gradle
    • Plugin Declaration
    • Common Conventions
    • Converting Dependency Management
    • Repository Configuration
  • Publishing - Code Coverage - Reporting
    • Publishing Artifacts
    • Continuous Integration
    • Generating Documentation
    • Code Coverage
    • Code Analysis Reports
    • Exercise: Code Coverage
  • Creating Plugins
    • Why Plugins?
    • Creating a Custom Plugin
    • Creating a Standalone Plugin
    • Configuring Extensions
    • Exercise: Creating Plugins
  • Summary and References
    • Summary
    • References
    • Online References
    • Other Interesting Courses Related to Gradle