我想将google-services
Gradle插件从本地jar应用到Java项目,这样我的构建就不需要连接到jcenter即可下载插件。
我已经下载了google-services-3.0.0.jar
,但是我不知道如何告诉gradle从文件中加载插件。
这是我的build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0' <---i have the jar
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
最佳答案
我可以通过将jar添加到我的lib文件夹中,然后从项目gradle依赖项中调用它来从jar添加插件:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath fileTree(include: ['*.jar'], dir: 'app/libs')
classpath files('app/libs/google-services-3.0.0.jar')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
关于java - 将插件添加到本地jar的gradle buildscript中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53727341/