Shadow configures the default shadowJar task to merge all dependencies from the project's runtime configuration
into the final JAR.
The configurations to from which to source dependencies for the merging can be configured using the configurations property
of the ShadowJar task type.

shadowJar {
configurations =[project.configurations.compile]}

The above code sample would configure the shadowJar task to merge depdencies from only the compile configuration.
This means any dependency declared in the runtime configuration would be not be included in the final JAR.

Note the literal use of project.configurations when setting the configurations attribute of a
ShadowJar task.
This is required. It maybe be tempting to specify configurations = [configurations.compile] but this will not
have the intended effect, as configurations.compile will try to delegate to the configurations property of the
the ShadowJar task instead of the project

Because of the way that Gradle handles dependency configuration, from a plugin perspective, shadow is unable to
distinguish between a jar file configured as a dependency and a jar file included in the resource folder. This means
that any jar found in a resource directory will be merged into the shadow jar the same as any other dependency. If
your intention is to embed the jar inside, you must rename the jar as to not end with .jar before the shadow task
begins.

Individual dependencies can be filtered from the final JAR by using the dependencies block of a
ShadowJar task.
Dependency filtering does not apply to transitive dependencies.
That is, excluding a dependency does not exclude any of its dependencies from the final JAR.

The dependency blocks provides a number of methods for resolving dependencies using the notations familiar from
Gradle's configurations block.

While not being able to filter entire transitive dependency graphs might seem like an oversight, it is necessary
because it would not be possible to intelligently determine the build author's intended results when there is a
common dependency between two 1st level dependencies when one is excluded and the other is not.