41 lines
1.1 KiB
Plaintext
41 lines
1.1 KiB
Plaintext
== Why is this an issue?
|
|
|
|
In order to extend the functionalities of your Gradle build you can add plugins with `id("plugin-id")`. Gradle maintains some plugins that are known as https://docs.gradle.org/current/userguide/plugin_reference.html[core plugins]. These core plugins can be identified by a short name.
|
|
|
|
When adding core plugins, it is a good practice to use their short name because it is more concise, readable, and less prone to typing mistakes.
|
|
|
|
== How to fix it
|
|
|
|
Replace `id("core-plugin-id")` with the core plugin short name.
|
|
|
|
=== Code examples
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,kotlin,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
plugins {
|
|
id("org.gradle.java")
|
|
id("org.gradle.jacoco")
|
|
id("org.gradle.maven-publish")
|
|
}
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,kotlin,diff-id=1,diff-type=compliant]
|
|
----
|
|
plugins {
|
|
java
|
|
jacoco
|
|
`maven-publish`
|
|
}
|
|
----
|
|
|
|
== Resources
|
|
|
|
=== Documentation
|
|
|
|
* https://docs.gradle.org/current/userguide/plugin_reference.html[Gradle core plugins reference]
|
|
* https://docs.gradle.org/current/userguide/plugins.html[Gradle plugins]
|