Advanced Gradle knowledge for high-flying developers

Become the hero your Java build needs, within days, not years

Why Can You Write Gradle in 2 Different Languages?

The very first version of Gradle had build scripts written in the dynamic Groovy language. Why then, years later, did team Gradle add Kotlin as a 2nd option?

May 7, 2023

Did you update to Gradle 8 yet?

A week ago Gradle 8.0 was released. I was totally unprepared. The previous version was 7.6, so this was a new major version. Yeah, I should have known that things would break. When possible, I recommend using the latest Gradle version. In this article, I highlight issues I overcame and the related Gradle features. This might help your update process be less painful. Java toolchain changes The Java toolchain forces Gradle to build your application with a specific Java version, irrespective of the version you use to run Gradle itself....

February 18, 2023

3 Ways To Effectively Manage Gradle Projects in GitHub

If you manage more than a few GitHub repositories, you’ll know that it takes conscious effort to keep them updated. Your project’s dependencies and Gradle version go out of date fast, and probably without you realising. Scale up to 50+ repositories, and you’ve got a big time drain on your hands. Fortunately, GitHub has features to help. In this article, you’ll discover 3 ways to save time and get organised with your Gradle projects in GitHub....

January 7, 2023

Gradle vs. npm

Gradle and npm are build tool giants of their respective Java and JavaScript worlds. But differences in how each tool builds software make it tough to switch from one to the other. To help you bridge the gap, this article explains the main differences and similarities, giving you a deeper understanding of these powerful build tools. What is Gradle? Gradle is a build automation tool, mainly used to build Java applications....

December 31, 2022

13 Key Gradle Fundamentals From A Hello World Project

In software languages and tools like Gradle, Hello World is the simplest example to get you started, before moving onto more advanced topics. But in our hurry to move on, we miss important lessons staring us in the face. Here are 13 key learnings from a Gradle Hello World project, forming the fundamentals of this powerful build tool. If you thought Gradle can be complicated, you’re right. It offers advanced features to satisfy LinkedIn, Netflix, and other companies operating at massive scale....

December 14, 2022

10 Best Gradle Plugins for Java Projects

With so many Gradle plugins to choose from, are you sure you’re making the most of what’s available? If not, check out this list of the 10 best core Gradle plugins to work more effectively in Java projects. How were these plugins chosen? These are all core Gradle plugins, written by the Gradle team and bundled inside the Gradle distribution itself. That means they’re high quality and there’s no need to download them externally....

May 1, 2022

10 Tips to Use Gradle With IntelliJ IDEA in 2022

If you’re building Gradle projects in IntelliJ IDEA, you’re probably not using the IDE to its full advantage. So to help you save time and avoid unnecessary work, here are my top 10 tips to working like a pro. 1) Create Gradle project using IntelliJ IDEA First off, use IntelliJ IDEA it to create new Gradle projects. From the Welcome to IntelliJ IDEA screen select New Project to open the New Project dialog....

April 6, 2022

4 Benefits Of Using Gradle Multi-Project Builds

If your Gradle build has only a single project then you could be missing out on important benefits of multi-project builds. Splitting Gradle projects into multiple subprojects is almost always a good idea, so in this article you’ll discover the 4 benefits of using Gradle multi-projects builds to setup your project for success. Single vs. multi-project builds Before we get into the 1st benefit, let’s define what a multi-project build is and how it differs from a single-project build....

March 1, 2022

How to add a Gradle dependency

Discover the best way to add a dependency to a Gradle project and understand what Gradle does to make the dependency available to your application code. Sometimes when you’re developing an application you need to use code from another library. In the below Java application built with Gradle, I want to use the StringUtils class to process the input by switching it to upper case. package com.tomgregory; import org.apache.commons.lang3.StringUtils; public class Application { public static void main(String[] args) { String processedString = StringUtils....

January 14, 2022

Gradle assemble task essentials

Learn everything you’ll ever need to know about Gradle’s task for creating artifacts, assemble. Assemble is a task you run from the command line using ./gradlew assemble in Linux and Mac or gradlew assemble in Windows. To fully understand assemble you need to know about the 2 types of Gradle tasks: actionable tasks have some action(s) attached to do work in your build lifecycle tasks are workflow tasks with no actions attached Assemble is a lifecycle task with no actions attached....

January 13, 2022