Gradle Plugins TODEPLETE: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
Most of Gradle's power comes from external plugins. A plugin is an extension to Gradle which configures the [[Gradle_Project_and_Build_Script#Overview|project]] it is applied to in some way, typically by adding plugin-specific [[Gradle_Dependencies_and_Dependency_Configurations#Dependency_Configuration|dependency configurations]], [[Gradle_Task#Overview|tasks]] and [[Gradle_Variables_and_Properties#Overview|properties]]. Plugins can be applied to Projects because Project implements [https://docs.gradle.org/current/dsl/org.gradle.api.plugins.PluginAware.html PluginAware]. | Most of Gradle's power comes from external plugins. A plugin is an extension to Gradle which configures the [[Gradle_Project_and_Build_Script#Overview|project]] it is applied to in some way, typically by adding plugin-specific [[Gradle_Dependencies_and_Dependency_Configurations#Dependency_Configuration|dependency configurations]], [[Gradle_Task#Overview|tasks]] and [[Gradle_Variables_and_Properties#Overview|properties]]. Plugins can be applied to Projects because Project implements [https://docs.gradle.org/current/dsl/org.gradle.api.plugins.PluginAware.html PluginAware]. | ||
=Plugin List= | =Plugin List= | ||
Line 22: | Line 16: | ||
* [[Gradle_Maven_Plugin#Overview|Maven Plugin]] | * [[Gradle_Maven_Plugin#Overview|Maven Plugin]] | ||
* [[Gradle_Maven_Publish_Plugin#Overview|Maven Publish Plugin]] | * [[Gradle_Maven_Publish_Plugin#Overview|Maven Publish Plugin]] | ||
=Plugin Initialization= | |||
<syntaxhighlight lang='groovy'> | |||
apply plugin:'java' | |||
</syntaxhighlight> | |||
=External Plugins= | =External Plugins= |
Revision as of 22:27, 23 May 2018
External
Internal
Overview
Most of Gradle's power comes from external plugins. A plugin is an extension to Gradle which configures the project it is applied to in some way, typically by adding plugin-specific dependency configurations, tasks and properties. Plugins can be applied to Projects because Project implements PluginAware.
Plugin List
Plugin Initialization
apply plugin:'java'
External Plugins
If a build requires external plugins that need to be downloaded dynamically, build.gradle allows for a special script block buildscript{...} to declare where to download those plugins from. If the plugin is unknown, Gradle will fail with:
Plugin with id 'nebula.ospackage-application' not found.
An external plugin is declared as follows:
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.netflix.nebula:gradle-ospackage-plugin:4.3.0'
}
}