简体   繁体   English

将github库添加为gradle中的依赖项

[英]Add github library as dependency in gradle

How to add library from github using gradle? 如何使用gradle从github添加库? I tried this and it didn't work. 我试过了,但是没有用。 The library I want to use in my project is XLLoop . 我要在项目中使用的库是XLLoop Here is a code from build.gradle . 这是build.gradle的代码。

repositories {
    mavenCentral()
}
dependencies {
    compile 'com.github.poidasmith.xlloop:xlloop:0.3.+'
}

XXLoop isn't published as a Maven or Ivy artifact so it isn't directly available to Gradle's dependency management. XXLoop没有作为Maven或Ivy工件发布,因此它不能直接用于Gradle的依赖管理。

You would download the JARs for XXLoop and define dependencies for it's dependencies: 您将下载XXLoop的JAR,并为其依赖项定义依赖项:

repositories {
    mavenCentral()
}
dependencies {
    files('libs/xxloop_0.3.jar')
    compile 'something:xxloop-needs:0.1.2'
}

I've done this for a variety of things in production including the generated JARs for interacting with Salesforce or in-house libraries we don't have in an artifact repostory yet. 我已经在生产中做过很多事情,包括生成的用于与Salesforce交互的JAR或我们在人工制品目录中还没有的内部库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM