Search code examples
javamavenjitpack

Can't build using JitPack.io


I am trying

<!-- https://github.com/lbehnke/hierarchical-clustering-java.git -->
<dependency>
<groupId>com.github.lbehnke</groupId>
<artifactId>hierarchical-clustering-java</artifactId>
<version>anyBranch-SNAPSHOT</version>
</dependency>

is that the right way to use it?

I've added

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

and I am trying to build from inside eclipse (of course it's a maven project)

error says

Missing artifact com.github.lbehnke:hierarchical-clustering-
java:jar:anyBranch-SNAPSHOT

and

The container 'Maven Dependencies' references non existing 
library '/home/leoks/.m2/repository/com/github/lbehnke/hierarchical-
clustering-java/anyBranch-SNAPSHOT/hierarchical-clustering-
java-anyBranch-SNAPSHOT.jar'

ps. I've already checked these threads

How to use GitHub Repo using JitPack.io in Maven

Can I use a GitHub project directly in Maven?

But none seems to help

enter image description here


Solution

  • Change the version id for the tag id in your dependency.

    So in your case, for version v1.1.0 the tag id is d74af46. Found at: Repository page -> releases -> lefthand column (under the version id).

    <dependency>
    <groupId>com.github.lbehnke</groupId>
    <artifactId>hierarchical-clustering-java</artifactId>
    <version>d74af46</version>
    </dependency>    
    

    This doesn't gives you the SNAPSHOT version but at least should compile. I tested here and it worked.

    Source: https://github.com/vidstige/jadb/issues/14