Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.nishtahir:gradle-gitpack-plugin:'
}
dependencies {
implementation("com.github.nishtahir:gradle-gitpack-plugin:")
}
<dependency>
<groupId>com.github.nishtahir</groupId>
<artifactId>gradle-gitpack-plugin</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.nishtahir" % "gradle-gitpack-plugin" % ""
:dependencies [[com.github.nishtahir/gradle-gitpack-plugin ""]]
Inspired by Jitpack.io, this plugin allows you to add public github or gitlab repositories as dependencies directly to your java projects.
Add the plugin to your buildscript
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'com.nishtahir:gradle-gitpack-plugin:1.0-SNAPSHOT'
}
}
And apply the plugin to your build
apply plugin: 'com.nishtahir.gradle-gitpack-plugin'
Declare compile time dependencies using git
dependencies {
git 'com.github.nishtahir:ALang:SNAPSHOT'
}
they should be in the format
git com.[github/gitlab].[username]:[project name]:[version]