JitPack发布开源库 - bei1999/work GitHub Wiki

JitPack是什么

JitPack是一个自定义的Maven仓库。

为什么使用它

之前尝试过maven central, jCenter,今天尝试了下jitpack发布android 库,发现真的很好用!

配置

项目根目录build.gradle

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'

       // JitPack Maven Gradle Plugin
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // Add this line

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {

    repositories {
        google()
        jcenter()
    }

}

library 包build.gradle 添加如下:

apply plugin: 'com.github.dcendents.android-maven'
// Your Group
group='com.github.bei1999'

进入 https://jitpack.io,输入github 仓库地址生成库链接

生成如下:

使用

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

加入项目依赖

dependencies {
    compile 'com.github.bei1999:CommonUtils:1.0.1'
}

完整示例

JitPack地址