当前位置: 首页 > 软件库 > 手机/移动开发 > >

jitpack.io

Documentation and issues of https://jitpack.io
授权协议 MIT License
开发语言 Java
所属分类 手机/移动开发
软件类型 开源软件
地区 不详
投 递 者 夏季萌
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

JitPack.io

JitPack is a novel package repository for JVM and Android projects. It builds Git projects on demand and provides you with ready-to-use artifacts (jar, aar).

If you want your library to be available to the world, there is no need to go through project build and upload steps. All you need to do is push your project to GitHub and JitPack will take care of the rest. That’s really it!

In case your project is already on GitHub, JitPack makes sure it can be built by anyone. Want to use a GitHub library in your project? Follow the simple steps explained in the ‘Building with JitPack’ section.

For issues and enhancements, please use the JitPack GitHub repository. The repository contains this documentation and contributions are welcome there as well.

If you'd like some help with setting up repositories please use the Support button on the web site.

Building with JitPack

If you are using Gradle to get a GitHub project into your build, you will need to:

Step 1. Add the JitPack maven repository to the list of repositories:

url "https://jitpack.io"

Step 2. Add the dependency information:

  • Group: com.github.Username
  • Artifact: Repository Name
  • Version: Release tag, commit hash or master-SNAPSHOT

That's it! The first time you request a project JitPack checks out the code, builds it and sends the Jar files back to you.

To see an example head to jitpack.io and 'Look Up' a GitHub repository by url.

Gradle example:

allprojects {
        repositories {
            jcenter()
            maven { url "https://jitpack.io" }
        }
   }
   dependencies {
        implementation 'com.github.User:Repo:Version'
   }

Note: when using multiple repositories in build.gradle it is recommended to add JitPack at the end. Gradle will go through all repositories in order until it finds a dependency.

Snapshots

A snapshot is a version that has not been released. The difference between a real version and a snapshot is that snapshot might still get updates. Snapshot versions are useful during development process and JitPack provides two ways to get them. You can specify a version for your dependency as:

  • commit hash

  • branch-SNAPSHOT (replace 'branch' with any branch name, e.g. master)

For example:

// dependency on the latest commit in the master branch
    implementation 'com.github.jitpack:gradle-simple:master-SNAPSHOT'

Adding -SNAPSHOT will build the latest commit on the master branch.

Gradle can cache the SNAPSHOT builds. You could add the following configuration in your build.gradle file in order to ensure Gradle always picks up the 'freshest' version of the build:

configurations.all {
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

Building a new snapshot may take some time so it might be necessary to increase Gradle timeouts (FAQ).

Or you could also run Gradle from the command line with the --refresh-dependencies flag. See the Gradle documentation for more information on how to configure caching for changing dependencies.

Note If using Android Studio, don't forget to press File->Synchronize after updating to a newer snapshot.

Also see the Guide to building for more details and instructions on building multi-module projects.

If the project doesn't have any GitHub Releases, you can get the latest snapshot build. In this case, use the short commit id as the version. You can also place tags on other branches and then build using those tags.

Tip: You can also automate GitHub releases with Gradle release & version management plugin

Pull Requests

In addition to snapshot builds JitPack supports building Pull Requests. Simply use PR<NR>-SNAPSHOT as the version.

For example:

// dependency for Pull Request 4
    implementation 'com.github.jitpack:gradle-simple:PR4-SNAPSHOT'

Publishing on JitPack

Publishing your library on JitPack is very simple:

As long as there's a build file in your repository and it can install your library in the local Maven repository, it is sufficient for JitPack. See the Guide to building on how to publish JVM libraries and Guide to Android on how to publish Android libraries.

Tip: You can try out your code before a release by using the commit hash as the version.

Some extras to consider

Add dependency information in your README. Tell the world where to get your library:

repositories {
        jcenter()
        maven { url "https://jitpack.io" }
   }
   dependencies {
         implementation 'com.github.jitpack:gradle-simple:1.0'
   }
  • Add sources jar. Creating the sources jar makes it easier for others to use your code and contribute.

Features

Javadoc publishing

  • For a single module project, if it produces a javadoc.jar then you can browse the javadoc files directly at:

    • https://jitpack.io/com/github/USER/REPO/VERSION/javadoc/ or
    • https://jitpack.io/com/github/USER/REPO/latest/javadoc/ (latest release tag)
  • For a multi module project, the artifacts are published under com.github.USER.REPO:MODULE:VERSION, where MODULE is the artifact id of the module (not necessarily the same as the directory it lives in)

  • Javadocs for a multi-module project follow the same convention, i.e.

    • https://jitpack.io/com/github/USER/REPO/MODULE/VERSION/javadoc/
  • Aggregated javadocs for a multi-module project may be available if the top level aggregates them into a jar and publishes it. The module name in this case is the artifact id of the top level module.

  • See the example projects on how to configure your build file (Android example).

Other features

  • Private repositories
  • Dynamic versions. You can use Gradle's dynamic version '1.+' and Maven's version ranges for releases. They resolve to releases that have already been built. JitPack periodically checks for new releases and builds them ahead-of-time.
  • Build by tag, commit id, or anyBranch-SNAPSHOT.
  • You can also use your own domain name for group

Immutable artifacts

Public repository artifacts on JitPack are immutable after 7 days of publishing. You will see an indicator in the list of versions when a build becomes frozen (snowflake icon).Withing the first 7 days they can be re-built to fix any release issues. Even then we recommend creating a patch release instead.

JitPack will also keep hosting artifacts after the originating git repository is deleted.To delete a build you need to have git push permissions to your git repository.

Other Git hosts

JitPack also works with other Git hosting providers. The only difference is the groupId of your artifacts:

  • BitBucket: org.bitbucket.Username:Repo:Tag

  • GitLab: com.gitlab.Username:Repo:Tag

  • Gitee: com.gitee.Username:Repo:Tag

  • Azure: com.azure.Project:Repo:Tag

To see an example, head to https://jitpack.io and 'Look Up' a Git repository by url.

Self-hosted Git servers like GitLab are also supported. You can register your server on your user page.

Custom domain name

If you want to use your own domain name as the groupId instead of com.github.yourcompany, you can.We support mapping your domain name to your GitHub organization. Then, instead of 'com.github.yourcompany' groupId, you can use 'com.yourcompany' while the name of the project and version remains the same.

To enable your own domain name:

  1. Add a DNS TXT record that maps git.yourcompany.com to https://github.com/yourcompany. This needs to be configured at your domain name provider such as GoDaddy. For example see How to add a TXT record.

  2. Go to https://jitpack.io/#com.yourcompany/yourrepo and click Look up. If DNS resolution worked then you should see a list of versions.

  3. Select the version you want and click 'Get it' to see Maven/Gradle instructions.

Example: https://jitpack.io/#io.jitpack/gradle-simple

To check that the DNS TXT record was added, run the command dig txt git.yourcompany.com. For example:

~$ dig txt git.jitpack.io
...
;; ANSWER SECTION:
git.jitpack.io.		600	IN	TXT	"https://github.com/jitpack"

Badges

Add this line to your README.md to show a status badge with the latest release:

[![Release](https://jitpack.io/v/User/Repo.svg)]
(https://jitpack.io/#User/Repo)

If you are using a custom domain or BitBucket, use:

[![Release](https://jitpack.io/v/com.example/Repo.svg)]
(https://jitpack.io/#com.example/Repo)


[![Release](https://jitpack.io/v/org.bitbucket.User/Repo.svg)]
(https://jitpack.io/#org.bitbucket.User/Repo)

Or, if you prefer the flat-squared style:

https://jitpack.io/v/User/Repo.svg?style=flat-square

Continuous Integration (CI)

In addition to publishing artifacts, JitPack can run your whole build pipeline. JitCI is an all-in-one solution to publish high quality libraries with ease. It provides the following features:

  • Running tests
  • Code Coverage
  • Dependency Audit
  • License Checks
  • Vulnerability Reports
  • Publishing to JitPack

You can enable the CI from project settings or simply sign-in on jitci.com and add your repository.

FAQ

See the FAQ page

  • JitPack.io 是一个 GitHub 开源代码库的便捷发布渠道。它可以让你的 Android/Java 代码库自动完成发布,从而令使用者能够最便利地享受到你的代码库。 本质上说,一切能够通过 Maven Repository 发布的代码库,你都可以借助 JitPack 的自动打包和发布功能,从 GitHub 上发布给大众使用。例如你的 Kotlin/Java 代码库,SpringBoot 工

  • 问题 1 ) 根据要求,在build.gralde中明明已经添加了以下代码,但依旧下载不了相应的aar 或 jar allprojects { repositories { maven { url "https://jitpack.io" } } } 但是当我们把链接(https://jitpack.io/com/xxx/xxx-1.0.0.aar)用浏览器打开,

  • 一 介绍 1.1 JitPack是干嘛的? JitPack用来管理项目。为了在JitPack上发布您的库,您只需要在Git存储库中使用一个有效的构建文件。 JitPack当前可以构建Gradle,Maven,Sbt和Leiningen项目。让我们知道是否要与其他构建工具一起使用。具体使用可以查看官网。 流程极度简化,只需要输入Github项目地址就可发布项目,大大方便了像我这种懒得配置环境的人。

  • repositories { maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } mavenCentral() } 很熟悉的依赖问题,没有VPN的情况下,都知道翻墙下载依赖库几乎都是失败告终,所以都把地址指向国内阿里云的镜像仓库,下载

  • 1.关于 JitPack JitPack实际上是一个自定义的Maven仓库,不过它的流程极度简化,只需要输入Github项目地址就可发布项目,大大方便了像我这种懒得配置环境的人。 2.使用总结 关于如何配置和使用,请参考这篇文章: http://blog.csdn.net/user11223344abc/article/details/78403537 本文就使用之后,进行一点简单的总结: 一般来

  • 将Android studio升级为新的小松鼠版本后创建新的项目在build.gradle的repositories添加 maven { url 'https://jitpack.io' }时,在build.gradle中找不到repositories,并且发现build.gradle文件内容和格式发生了改变。 后来发现添加的位置发生了改变新的位置是settings.gradle下: ​​​​​

  • 前言 应该有不少android开发将自己的开源库使用jitpick.io进行打包和共享,最近Android studio更新Fox以后,如果gradle使用7.0以上版本,就必须需要使用java11进行编译了,但是jitpick.io默认的打包环境是java8,如果贸贸然上线,就会打包出错。 解决 在你的存储库的根目录添加一个文件:jitpack.yml 输入以下内容: jdk: - open

  • 前言 之前一直都是使用Android studio开发开源库放到jitpack.io上编译打包,最近由于研究jetbrains的kotlin multiplatform所以改成在IDEA中开发独立的jvm库或multiplatform库,multiplatform库放在jitpack.io上是肯定会出问题的,因为jitpack.io上只有jvm环境。但是jvm库放上去也出现编译成功,打包错误,ER

  • AndroidStudio build出现https://jitpack.io/XXX包无法下载问题 AndroidStudio build很长时间后出现https://jitpack.io/XXX包无法下载 需要将build.gralde中 maven { url "https://jitpack.io" } 替换为 maven { url 'https://www.jitpack.io'

  • Android Studio提交库至Bintray jCenter从入门到放弃 https://blog.csdn.net/qq_37381177/article/details/111366310?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522162484963016780269875657%2522%252C%2522scm%2

  • 可以解决无法导入包的问题 受到这个文章启发: https://blog.csdn.net/qq_39154376/article/details/107954664