DEV Community

Cheav Sovannarith
Cheav Sovannarith

Posted on • Originally published at Medium on

Loading Maven dependencies from GitHub

jitpack.io — github.com

Now you can import a Java library from a GitHub repo using JitPack.

In your pom.xml:

First Add repository:



<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>


Enter fullscreen mode Exit fullscreen mode

Second Add dependency:



<dependency>
    <groupId>com.github.User</groupId>
    <artifactId>Repo name</artifactId>
    <version>Release tag</version>
</dependency>


Enter fullscreen mode Exit fullscreen mode

Note : for release tag

Before we can use release tag as a version in dependency, we have to create release tag first.



$ git tag -a 0.0.1-SNAPSHOT -m "commit message"
$ git push origin --tag


Enter fullscreen mode Exit fullscreen mode

*READ MORE * : https://git-scm.com/book/en/v2/Git-Basics-Tagging

Example : I have a Repository : https://github.com/sovannarithcheav/artifact-demo.git, So the dependency should look like this :



<dependency>
 <groupId>com.github.sovannarithcheav</groupId>
 <artifactId>artifact-demo</artifactId>
 <version>0.0.1-SNAPSHOT</version>
</dependency>


Enter fullscreen mode Exit fullscreen mode

It’s easy, right? 😜

READ MORE : loading-maven-dependencies-from-github


Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay