項目可以通過添加向構(gòu)建腳本中加入插件的類路徑然后在應(yīng)用插件,添加作為外部JAR文件的二進(jìn)制插件.外部jar可以使用buildscrip{}塊添加到構(gòu)建腳本類路徑就像Section 62.6, “External dependencies for the build script”中描述的一樣.
Example 21.4. Applying a plugin with the buildscript block
build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:0.4.1"
}
}
apply plugin: "com.jfrog.bintray"