Publishing artifacts to Maven Central with Bintray & Gradle

Recently I joined a conversation on Twitter where the OP complained to spending hours to get a brand new computer setup to publish artifacts to Maven Central. The issue stemmed from having PGP signature files moved from one location to another. There are other issues that may arise when uploading artifacts to Maven Central, specially when doing it for the first time. The rules for publishing artifacts are stated here. A common mistake is to omit one of the required POM elements, which will likely trigger a series of back-and-forth revisions until you get it right. This can be frustrating Read More


Announcing the PomChecker project

I’m happy to announce the immediate availability of the PomChecker suite! What is it you ask? It’s a small set of utilities to verify that a POM or BOM file complies with the minimum requirements for being uploaded to Maven Central. I wish an utility like this existed years ago when I started publishing artifacts to Maven Central. It took me a few tries in the beginning to get the POM files just right. Recently I’ve seen other developers struggling with these rules as well. Hopefully these utilities can help them and others get on the road much faster. There Read More


Detecting duplicate dependencies in Maven

In late March 2020 I ran a quiz on Maven Dependency Resolution which turned out to be an eye opener for some people (including myself!). You can read the whole questionnaire, results, and analysis here. One of the surprising results was found in the very first question, a rather innocuous one but it resulted in a major stumbling block for 2/3 of respondents! Here’s the question What’s surprising is that only 36% people chose the correct answer and a similar percentage chose the “Build error” option because clearly duplicate dependencies ought to cause a build error, right? Wrong! Maven does Read More


Announcing the Gradle Enforcer Plugin

Inspired by the popular Maven Enforcer plugin I’m happy to announce that its Gradle counterpart has been released, say hello to the enforcer-gradle-plugin! The behavior provided by Gradle Enforcer plugin is very similar to what the Maven Enforcer plugin provides, in the sense that rules will be executed during a particular phase of the build; any rule violations result in a build failure. Rules are typically setup to check for preconditions and requirements. The Maven Enforcer plugin provides a set of core rules and extra rules. In turn, the Gradle Enforcer plugin provides a similar set plus a few rules Read More


Maven Dependencies Pop Quiz – Results

A couple of weeks ago I posted a link to a pop quiz regarding dependency resolution in Apache Maven. 509 brave souls took the challenge; now is the time to share the results. The quiz is comprised of 14 questions split between 3 sections based on context: A single project A project with a parent POM A project with a BOM Each question revolves around figuring out what would be the selected version of a particular dependency, in this case Guava, because as many developers know, whenever there’s a classpath issue Guava is always to blame (What?!) To be fair, Read More


Running Gradle inside Maven

As organizations evolve so do their codebases. Apache Maven and Gradle are the most popular and widely used build tools in the JVM. Usually multi-project builds rely on a single build tool to accomplish the job but there may be uses cases where you need to combine both, having Maven be the one leading the pack. One possible use case is to build a companion Gradle plugin, this is the case for ByteBuddy and Quarkus; another use case is to run a composite build with Maven and Gradle projects mixed together. In this post I’ll show how Gradle can be Read More


Composite builds with Maven and Gradle

Gradle offers a neat feature called “Composite Builds” which allows one project to consume artifacts from other builds as if they were part of a single coherent unit. This feature is pretty easy to setup, however you might not know that it’s possible to do the same with Maven. Here’s how. Let’s say you have a producer and consumer projects, where producer is set as a dependency on consumer. If these two projects are to have their own release lifecycles their file structure may look like this The contents of the Gradle build files look like so And in the Read More


ˆ Back To Top