搜索Gradle插件

使用插件DSL

plugins {
  id("io.freefair.okhttp") version "8.7.1"
}

使用旧插件应用程序

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org.cn/m2/")
    }
  }
  dependencies {
    classpath("io.freefair.gradle:okhttp-plugin:8.7.1")
  }
}

apply(plugin = "io.freefair.okhttp")

使用插件DSL

plugins {
  id "io.freefair.okhttp" version "8.7.1"
}

使用旧插件应用程序

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org.cn/m2/"
    }
  }
  dependencies {
    classpath "io.freefair.gradle:okhttp-plugin:8.7.1"
  }
}

apply plugin: "io.freefair.okhttp"

了解如何将插件应用到子项目中