Home » Tag Archives: Gradle

Tag Archives: Gradle

Building Java 6-8 Libraries for JPMS in Gradle

Find out how to use Gradle to build Java 6-8 libraries that support JPMS (Java Platform Module System) by providing Java 9 module-info.class. Introduction If you need introduction to JPMS itself, check out this nice overview. This post is primarily targeted at Java library maintainers. Any such maintainer has to make a choice of which JDK to target: Targeting the ...

Read More »

Reliable releasing to Maven Central from Travis using Gradle – 2019 edition

Make your (automatic) releasing to Maven Central from Travis (and not only) more reliable thanks to the explicit staging repository creation feature set implemented at the edge of 2018 and 2019. Background If you are only interested in getting information how to make your artifacts releasing more reliable from Travis, move forward to the another section. Automatic artifacts releasing (using ...

Read More »

Building monorepo projects with Gradle

According to Wikipedia, a monorepo is as software development strategy where many projects are stored in the same repository. This strategy allows for quick detection of potential problems and breakages caused by changes in dependencies, and it has been adopted by many organizations that work with large scale codebases, such as Google, Facebook, and Twitter. You too can apply this ...

Read More »

Create a Basic Android App without an IDE

“I love writing authentication and authorization code.” ~ No Java Developer Ever. Tired of building the same login screens over and over? Try the Okta API for hosted authentication, authorization, and multi-factor auth. Virtually every Android tutorial uses Android Studio to create and develop an app. This isn’t great for learning since you don’t see how things work, namely The ...

Read More »

Gradle multi project build – parent pom like structure

When you come from a maven background most probably you have been used to the parent pom structure. Now when it comes to gradle things are a little bit different. Imagine the scenario of having a project including the interfaces and various other implementations. This is going to be our project structure. multi-project-gradle -- specification -- core -- implementation-a -- ...

Read More »

Jib – Building docker image for a Spring Boot App

I was pleasantly surprised by how easy it was to create a docker image for a sample Spring Boot application using Jib. Let me first contrast Jib with an approach that I was using before. I was creating docker images using bmuschko’s excellent gradle-docker plugin. Given access to a docker daemon and a gradle dsl based description of the Dockerfile ...

Read More »

Gradle Tutorial

1. Introduction In this lesson, we will study about Gradle, which is a build tool and a dependency management system very similar to Maven and Ant and designed specifically for building Java-based projects. Unlike Maven and Ant build systems, Gradle doesn’t use XML. It is actually built in DSL based on Groovy. The biggest advantage Groovy-based Gradle scripts provided was ...

Read More »

Gradle Dependencies for Java, use compile or implementation?

While I was explaining to a colleague about using Gradle for Java projects (he was moving away from Maven), we came across various code samples. Some of the examples were using the compile configuration for dependencies, while others were using implements and api. dependencies { compile 'commons-httpclient:commons-httpclient:3.1' compile 'org.apache.commons:commons-lang3:3.5' } dependencies { api 'commons-httpclient:commons-httpclient:3.1' implementation 'org.apache.commons:commons-lang3:3.5' } This post was ...

Read More »

JRebel for a Gradle Spring Boot App

There is some documentation on how to add JRebel to a Spring Boot app that uses Gradle as the build tool. It is basic but works fine. All you have to do is to add a few lines to build.gradle: if (project.hasProperty('rebelAgent')) { bootRun.jvmArgs += rebelAgent } Then set the property in gradle.properties: rebelAgent=-agentpath:[path/to/JRebel library] However there are several ways ...

Read More »