1

I tried to use JitPack to add a forked library to my Android project.

allprojects {
    repositories {
        jcenter()
        google()
        maven { url 'https://jitpack.io'}
    }
}

After sync, my library was added correctly, but the problem is, the newest version of dependencies like Picasso and okio was retrieved, other than the version specified in gradle file.

implementation 'com.squareup.okio:okio:1.9.0'
implementation 'com.squareup.picasso:picasso:2.5.2'

Also tried to use includeGroup to only retrieve my own library via JitPack, but it still get the newest packages somehow.

maven { url 'https://jitpack.io'
            content {
                includeGroupByRegex "com\\.github\\.myusername.*"
            }}

I assume it's a maven repository problem but don't really understand what's going on. Any suggestion is welcomed!

Selkie
  • 1,773
  • 1
  • 14
  • 21

1 Answers1

0

Maven dependencies are specified as

groupid:artifact:version

On most Maven repositories, they are taken from the pom.xml of the library.

JitPack works differently here:

  • the groupid identifies the git hosting service and user, e.g. com.gitlab.johndoe
  • artifact is the project name on that git hosting service, as found in the URL
  • version is a git ref, i.e. a tag or branch name, or a commit hash

There are ways to keep these in sync:

  • for the domain that corresponds to your groupid, configure a TXT record with a URL which points to the corresponding user or organization at the git hoster
  • choose the artifact name and project name to be the same
  • tag each release in git with the version number it has in pom.xml.

Otherwise, you will have to modify your dependencies so JitPack will find them.

user149408
  • 5,385
  • 4
  • 33
  • 69