搜索 Gradle 插件

使用 plugins DSL

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

使用 旧插件应用

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

apply(plugin = "io.freefair.compress.trees")

使用 plugins DSL

plugins {
  id "io.freefair.compress.trees" version "8.7.1"
}

使用 旧插件应用

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

apply plugin: "io.freefair.compress.trees"

学习如何将插件应用到子项目中