Switch Theme

Downloading Gradle Artifacts without a Repository

dev gradle java

1/9/2025

1 min. read

Starting 2025 with a new project, gitle. It’s a gradle plugin that downloads and builds Maven/Gradle dependencies that aren’t published to a repository, like Maven Central, GitHub Packages, or any other kind of repository hosting.

Prerequisites

Gitle requires Java 17 or higher for your build project. In addition, your artifacts must be accessible via a Git provider. There is extended support for GitHub and GitLab as well.

Your dependency must be built with either Maven or Gradle. If it uses Gradle, it must apply the maven-publish plugin with a proper configuration.

How does it Work?

gitle clones a Git repository to your machine, builds the project, and publishes it to your local maven repository. When applying the plugin, it will automatically include the mavenLocal() repository.

import xyz.gmitch215.gitle.import
import xyz.gmitch215.gitle.github

plugins {
    id("xyz.gmitch215.gitle") version "0.1.0"
}

dependencies {
    import("https://github.com/example/repo.git")
    import(github("OtherUser", "OtherRepository"))
    
    implementation("com.example:artifact:1.0.0")
}

Using a GitHub Repository

If your dependency is on GitHub, but isn’t published anywhere, you can use gitle to clone the repository.

Apply the plugin and use the import function, along with the github function. Here’s an example with one of my projects, TabroomAPI

import xyz.gmitch215.gitle.import
import xyz.gmitch215.gitle.github

dependencies {
    import(github("gmitch215", "TabroomAPI"))
    
    implementation("xyz.gmitch215.tabroomapi:tabroomapi-jvm:0.3.0")
}

Using a GitLab Repository

Kind of the same logic with GitHub Repositories.

import xyz.gmitch215.gitle.import
import xyz.gmitch215.gitle.gitlab

dependencies {
    import(gitlab("gitlab.example.com", "MyUser/MyProject"))
    
    implementation("com.example:artifact:1.0.0")
}

Conclusion

This was a short demo featuring gitle, a gradle plugin that allows you to download gradle artifacts without a nexus repository.

For more information, look at the wiki.