You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gradle-plugins/gradle-plugin-shadow/src/docs/asciidoc/15-minimizing.adoc

26 lines
689 B
Plaintext

=== Minimizing
Shadow can automatically remove all classes of dependencies that are not used by the project, thereby minimizing the resulting shadowed JAR.
.Minimizing an shadow JAR
[source,groovy,indent=0]
----
shadowJar {
minimize()
}
----
A dependency can be excluded from the minimization process thereby forcing it's inclusion the shadow JAR.
This is useful when the dependency analyzer cannot find the usage of a class programmatically, for example if the class
is loaded dynamically via `Class.forName(String)`.
.Force a class to be retained during minimization
[source,groovy,indent=0]
----
shadowJar {
minimize {
exclude(dependency('org.scala-lang:.*:.*'))
}
}
----