Building ThinWARs with Gradle

UPDATE: As it turns out the two POM files (javaee-api 8.0) (microprofile 1.3) consumed by the build files shown here are not real BOMs. A POM is considered a BOM if it defines a <dependencyManagement> block which neither of these files do. They are just regular POM files for which the regular dependency resolution mechanism works out of the box. This means there’s no strict requirement for building ThinWARs with Gradle 5.0, you can use earlier versions too. The Gradle build file has been updated to reflect this change however the screencast remains unchanged. Java Champion Adam Bien has advocated Read More


Hooking Gradle build scans notifications to Gitter

Recently I posted on the benefits of enabling build scans on your project, as you may appreciate in the screenshots you get a link to the build scan’s URL as a result when the build is run. This URL is build specific and only those that have access to the build log will be able to see the link. What if you wanted to share the link with others? There are many ways to share information about a project hosted on GitHub/Gitlab/Bitbucket, one of them happens to be Gitter.im. Gitter.im is a messaging system that connects with GitHub repositories, bringing Read More


Improving build times with Gradle build scans

Waiting for code to compile is something that Java developers experience daily. Waiting for a full build to finish before continuing on your next task can take even longer time. There must be a better way to increase consumption of computing power and reduce waiting times. Let me show you one way to make this happen with a concrete example. The Sentinel project by Alibaba is a very popular project in China, self described as A lightweight powerful flow control component enabling reliability and monitoring for microservices In particular this project defines capabilities that are time sensitive (sync and async) Read More


On joining Gradle

A new year brings new opportunities, and in my case a new job The Gradle build tool has been an integral part of my developer career (both closed and open source) as you may have guessed by the content found in this blog. I’ve been an avid user of Gradle since the early days (my first build was made with Gradle 0.4) which means I’ve seen the tool grow to its current state as an outsider, I’m delighted and excited to helping steer its growth from the inside. I look forward to continue engaging the broad Gradle community and beyond. Read More


Gaining insight into a Gradle build

Every Gradle build has access to a default set of tasks that can deliver insight information on your build settings. You probably have come across the dependencies task. This task can display dependencies associated with all configurations of a particular project; you can even instruct which configuration to be queried if the list of configurations happens to be very long. Let’s say we have a Java project that looks like this build.gradle plugins { id ‘java’ id ‘org.kordamp.gradle.project’ version ‘0.11.0’ } ext.build_property = ‘build’ config { license { enabled = false } publishing { enabled = false } } repositories Read More


5 Gradle plugins for working with modular Java projects

Java 9 was release in September 2017 and with it came a brand new modular platform known as JPMS, delivered by Project Jigsaw. Building projects that an leverage this new feature can be a bit daunting however the Gradle plugins in the following list can help you in keeping things under control. 1. JDeps – https://github.com/aalmiray/jdeps-gradle-plugin This plugin generates a report of your production code and compile/runtime dependencies using the jdeps tool available since Java 8. Jdeps can tell you if your codebase is vulnerable to API changes such as relying on internal APIs (like sun.misc.Unsafe) even if you don’t Read More


The Gradle SuperPOM

Following up with the Gradle POM, where a familiar structure found in Maven projects can be brought to Gradle projects, I’d like to discuss another Maven feature that many see as an advantage and that’s lacking in Gradle: the ability to enforce settings in a top-down fashion with hierarchical POM files. In Maven, a parent POM delivers configuration that will be used by a child POM as is. Children POMs have the option to override and extend these properties. A typical use case in parent POMs is to provide <pluginManagement> and <dependencyManagement> sections; they also configure default dependencies, properties, plugins, Read More


The Gradle POM

Gradle is an extensible and very flexible build tool capable of building projects that target many platforms, not just Java. In the Java space it’s often compared to Apache Maven; one of the often cited complains against Gradle is that it’s “too complicated” or rather “too flexible” when compared to Apache Maven. It appears a large percentage of Maven users do love having a fixed structure that restricts the amount of havoc a junior developer may bring to the project if he or she desires to play with the build file. However this fixed structure also restricts power users from Read More


An opinionated way to build Gradle projects

If given a choice I’d pick Gradle over Maven as build tool 9 times out of 10. Gradle is a very extensible tool which has allowed me to customize my builds exactly how I want them to be, however this flexibility comes at a price as there’s a lot of configuration that has to applied to make a project follow a certain structure. Let’s say you’ve created a project and release it as Open Source. You’d typically post a release to Maven Central which requires following these guidelines, which include A well defined POM file. Attach a sources JAR. Attach Read More


ˆ Back To Top