You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The [`ShadowJar`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html) task type extends from Gradle's
7
+
The [`ShadowJar`](../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html) task type extends from Gradle's
This is **required**. It may be tempting to specify `configurations = [configurations.compile]` but this will not
30
-
have the intended effect, as `configurations.compile` will try to delegate to the `configurations` property of the [`ShadowJar`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html) task instead of the `project`
30
+
have the intended effect, as `configurations.compile` will try to delegate to the `configurations` property of the [`ShadowJar`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html) task instead of the `project`
31
31
32
32
## Embedding Jar Files Inside Your Shadow Jar
33
33
@@ -72,7 +72,7 @@ See also [Adding Extra Files](../README.md#adding-extra-files)
72
72
## Filtering Dependencies
73
73
74
74
Individual dependencies can be filtered from the final JAR by using the `dependencies` block of a
This is a concept that has been carried over from the original Maven Shade implementation.
6
-
A [`ResourceTransformer`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-resource-transformer/index.html) is invoked for each
6
+
A [`ResourceTransformer`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-resource-transformer/index.html) is invoked for each
7
7
entry in the JAR before being written to the final output JAR.
8
-
This allows a [`ResourceTransformer`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-resource-transformer/index.html) to
8
+
This allows a [`ResourceTransformer`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-resource-transformer/index.html) to
9
9
determine if it should process a particular entry and apply any modifications before writing the stream to the output.
10
10
11
11
=== "Kotlin"
@@ -147,7 +147,7 @@ At runtime, this file is read and used to configure library or application behav
147
147
148
148
Multiple dependencies may use the same service descriptor file name.
149
149
In this case, it is generally desired to merge the content of each instance of the file into a single output file.
150
-
The [`ServiceFileTransformer`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-service-file-transformer/index.html)
150
+
The [`ServiceFileTransformer`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-service-file-transformer/index.html)
151
151
class is used to perform this merging. By default, it will merge each copy of a file under `META-INF/services` into a
152
152
single file in the output JAR.
153
153
@@ -168,17 +168,17 @@ single file in the output JAR.
168
168
```
169
169
170
170
The above code snippet is a convenience syntax for calling
> Groovy Extension Module descriptor files (located at `META-INF/services/org.codehaus.groovy.runtime.ExtensionModule`)
174
-
are ignored by the [`ServiceFileTransformer`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-service-file-transformer/index.html).
174
+
are ignored by the [`ServiceFileTransformer`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-service-file-transformer/index.html).
175
175
This is due to these files having a different syntax than standard service descriptor files.
176
-
Use the [`mergeGroovyExtensionModules()`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/merge-groovy-extension-modules.html) method to merge
176
+
Use the [`mergeGroovyExtensionModules()`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/merge-groovy-extension-modules.html) method to merge
177
177
these files if your dependencies contain them.
178
178
179
179
### Configuring the Location of Service Descriptor Files
180
180
181
-
By default, the [`ServiceFileTransformer`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-service-file-transformer/index.html)
181
+
By default, the [`ServiceFileTransformer`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-service-file-transformer/index.html)
182
182
is configured to merge files in `META-INF/services`.
183
183
This directory can be overridden to merge descriptor files in a different location.
184
184
@@ -202,9 +202,9 @@ This directory can be overridden to merge descriptor files in a different locati
202
202
}
203
203
```
204
204
205
-
####Excluding/Including Specific Service Descriptor Files From Merging
205
+
### Excluding/Including Specific Service Descriptor Files From Merging
206
206
207
-
The [`ServiceFileTransformer`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-service-file-transformer/index.html)
207
+
The [`ServiceFileTransformer`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-service-file-transformer/index.html)
208
208
class supports specifying specific files to include or exclude from merging.
209
209
210
210
=== "Kotlin"
@@ -231,9 +231,9 @@ class supports specifying specific files to include or exclude from merging.
231
231
232
232
Shadow provides a specific transformer for dealing with Groovy extension module files.
233
233
This is due to their special syntax and how they need to be merged together.
234
-
The [`GroovyExtensionModuleTransformer`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-groovy-extension-module-transformer/index.html)
234
+
The [`GroovyExtensionModuleTransformer`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-groovy-extension-module-transformer/index.html)
235
235
will handle these files.
236
-
The [`ShadowJar`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html) task also provides a short syntax
236
+
The [`ShadowJar`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html) task also provides a short syntax
237
237
method to add this transformer.
238
238
239
239
=== "Kotlin"
@@ -276,11 +276,11 @@ containing Log4j 2.x Core components. It's a Gradle equivalent of [Log4j Plugin
276
276
## Appending Text Files
277
277
278
278
Generic text files can be appended together using the
Each file is appended using separators (defaults to `\n`) to separate content.
281
-
The [`ShadowJar`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html) task provides a short syntax
281
+
The [`ShadowJar`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html) task provides a short syntax
282
282
method of
283
-
[`append(String)`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/append.html) to
283
+
[`append(String)`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/append.html) to
284
284
configure this transformer.
285
285
286
286
=== "Kotlin"
@@ -331,10 +331,10 @@ configure this transformer.
331
331
## Appending XML Files
332
332
333
333
XML files require a special transformer for merging.
334
-
The [`XmlAppendingTransformer`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-xml-appending-transformer/index.html)
334
+
The [`XmlAppendingTransformer`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-xml-appending-transformer/index.html)
335
335
reads each XML document and merges each root element into a single document.
336
-
There is no short syntax method for the [`XmlAppendingTransformer`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-xml-appending-transformer/index.html).
337
-
It must be added using the [`transform`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/transform.html)) methods.
336
+
There is no short syntax method for the [`XmlAppendingTransformer`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.transformers/-xml-appending-transformer/index.html).
337
+
It must be added using the [`transform`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/transform.html)) methods.
Copy file name to clipboardExpand all lines: docs/custom-tasks/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
# Creating a Custom ShadowJar Task
2
2
3
3
The built in `shadowJar` task only provides an output for the `main` source set of the project.
4
-
It is possible to add arbitrary [`ShadowJar`](https://gradleup.com/shadow/api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html)
4
+
It is possible to add arbitrary [`ShadowJar`](../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html)
5
5
tasks to a project. When doing so, ensure that the `configurations` property is specified to inform Shadow which
6
6
dependencies to merge into the output.
7
7
8
8
=== "Kotlin"
9
9
10
10
```kotlin
11
11
val testShadowJar by tasks.registering(com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar::class) {
12
-
group = com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin.GROUP_NAME
12
+
group = LifecycleBasePlugin.BUILD_GROUP
13
13
description = "Create a combined JAR of project and test dependencies"
14
14
15
15
archiveClassifier = "tests"
@@ -33,7 +33,7 @@ dependencies to merge into the output.
0 commit comments