有人可以请指导我如何使用Jitpack构建github项目。使用Jitpack将Github包构建为Maven
我试着按照这条指令,总是出错。我分叉了一个项目并在其上添加了一些更改,因此我需要获取当前的提交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.
这里是我的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')
}
你会得到什么错误? – NRKirby
类似'无法解析com.github.username:repo:commitId'我尝试并更新代码并再次运行。现在gradle进程不会停止 –
我想我只会手动导入。我不知道我是否已经得到它,但似乎差不多一个小时,Gradle正在同步并且不会返回任何消息。 –