Following up on the previous post that explains how to setup the OCI Gradle Build Cache plugin on Travis-CI today I’d like to show how to do the same with GitHub Actions. The steps to follow are quite similar; if you do not already have an OCI account and/or a configured compartment then please follow steps 1, 2, and 3 as explained in this post, then proceed with the next steps Step 4: Apply the plugin to your project Paste the following into your settings.gradle file Notice that the location of the config file is local to the project. There’s Read More
Tag: plugin
Configuring the OCI Gradle Build Cache plugin with Travis-ci
The following post describes how to configure the oci-gradle-build-cache plugin to write to the cache when running on Travis-ci. I’m assuming dear reader that you have an Oracle Cloud account ready, but if that were not to be the case then you can sign up for an Always Free tier account at https://www.oracle.com/cloud/free/. Let’s get started! Step 1: Create a config file There are a couple of ways to configure the plugin, we’ll use a configuration file whose format is specified at this page; you must gather the following information from your account tenancy id user id default home region Read More
Announcing oci-gradle-plugin version 0.1.0
The first release of the OCI Gradle Plugin is out! The plugin lets you interact with the Oracle Cloud Infrastructure Java SDK. The behavior provided by OCI Java SDK is quite extensive, thus for this release the plugin delivers the minimal features required to setup and work with instances. Here’s an example, the following command will setup an Instance in a particular Compartment, while at the same time setting up a new VCN, Subnets, an InternetGateway and an InstanceConsoleConnection, allowing you to SSH to the freshly created instance $ ./gradlew setupInstance \ –compartment-id=ocid1.compartment.oc1…noa \ –instance-name=test \ –image=Oracle-Linux-7.6-2019.04.18-0 \ –shape=VM.Standard2.1 \ Read More
New features in Kordamp Gradle plugins
Version 0.14.0 of the Kordamp Gradle plugin suite is ready! This release brings a host of updates that should make your life easier when looking for gaining insights into your build. To begin with, all reporting tasks provided by the org.kordamp.gradle.base plugin will use ANSI colors if the terminal supports them. This make its easier to determine a particular setting, here’s for example the settings for the info and test (new) sections found in the alibaba/Sentinel project: The color code is as follows white: property names yellow: string literals cyan: numbers green: boolean, when true red: boolean, when false Speaking 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