Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/docs/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ and `relocationPrefix` settings on any `ShadowJar` task.
A simple Gradle plugin can use this feature by applying the `shadow` plugin and configuring the `shadowJar` task for relocation.

```groovy
dependencies {
shadow localGroovy()
shadow gradleApi()
apply plugin: 'java-gradle-plugin'
apply plugin: 'com.gradleup.shadow'

dependencies {
implementation 'org.jdom:jdom2:2.0.6'
implementation 'org.ow2.asm:asm:6.0'
implementation 'org.ow2.asm:asm-commons:6.0'
Expand All @@ -25,14 +25,10 @@ dependencies {

tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
enableRelocation = true
archiveClassifier = ''
}
```

Note that the `localGroovy()` and `gradleApi()` dependencies are added to the `shadow` configuration instead of the
normal `compile` configuration. These 2 dependencies are provided by Gradle to compile your project but are ultimately
provided by the Gradle runtime when executing the plugin. Thus, it is **not** advisable to bundle these dependencies
with your plugin.

## Publishing shadowed Gradle plugins
The Gradle Publish Plugin introduced support for plugins packaged with Shadow in version 1.0.0.
Starting with this version, plugin projects that apply both Shadow and the Gradle Plugin Publish plugin will be
Expand Down
Loading