使用Jitpack将Github包构建为Maven

Mig*_*ilk 7 git github maven

有人可以指导我如何使用Jitpack构建github项目.

我试图遵循这条指令,总是出错.我分叉了一个项目并在其上添加了一些更改,因此我需要将当前的提交ID作为版本.

要在您的构建中获得GitHub项目:

Step 1. Add the JitPack maven repository to your build file

    url "https://jitpack.io"

Step 2. Add the dependency in the form:

    Group: com.github.Username
    Artifact: Repository Name
    Version: Release tag or commit id

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.
Run Code Online (Sandbox Code Playgroud)

这是我的gradle文件

buildscript {
    repositories {
        mavenCentral()
        maven { url 'http://download.crashlytics.com/maven' }
        maven { url "https://jitpack.io" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
        classpath 'com.jakewharton.hugo:hugo-plugin:1.1.+'
        classpath 'com.stanfy.spoon:spoon-gradle-plugin:0.10.+'
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
    }
}


dependencies {
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.android.support:recyclerview-v7:22.0.0'

    //THIS ONE SEEMS NOT TO WORK BASE ON THE INSTRUCTION
    compile ('com.github.username:repo:commitId')
}
Run Code Online (Sandbox Code Playgroud)

这是项目

met*_*mer 15

buildscripts在这种情况下,不应该使用JitPack存储库.它应该只是在存储库下:

buildscript {
 // same as you have but without jitpack.io
}

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

dependencies {
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.android.support:recyclerview-v7:22.0.0'

    compile 'com.github.mightymilk:material-dialogs:v0.7.2.4'
    // or if you just want the 'aar':
    //compile 'com.github.mightymilk:material-dialogs:v0.7.2.4@aar'
}
Run Code Online (Sandbox Code Playgroud)

构建插件的存储库位于下面,buildscripts但正常的依赖存储库位于下面repositories {.