Skip to content

Commit

Permalink
Update docs on publishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnrengelman committed Apr 29, 2017
1 parent 7b379c9 commit 9696c4a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/docs/asciidoc/10-configuring.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ There may be situations where the desire is to **not** bundle select dependencie
they are still required for runtime execution.

In these scenarios, Shadow creates a `shadow` configuration to declare these dependencies.
Dependencies added to the `shadow` configuration are **not** bundled into the output JAR.
Dependencies added to the `shadow` configuration are *not* bundled into the output JAR.
Think of `configurations.shadow` as unmerged, runtime dependencies.
The integration with the `maven` and `maven-publish` plugins will automatically configure dependencies added
to `configurations.shadow` as `RUNTIME` scope dependencies in the resulting POM file.
Expand Down
22 changes: 20 additions & 2 deletions src/docs/asciidoc/40-publishing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

The Shadow plugin will automatically configure the necessary tasks in the presence of Gradle's
`maven-publish` plugin.
THe plugin will create and configure a software component named `"shadow"` for use with the
`publishing` block.
The plugin provides the `component` method from the `shadow` extension to configure the
publication with the necessary artifact and dependencies in the POM file.

.Publishing a Shadow JAR with the Maven-Publish Plugin
[source,groovy,indent=0]
Expand Down Expand Up @@ -49,3 +49,21 @@ uploadShadow {
}
}
----

=== Shadow Configuration and Publishing

The Shadow plugin provides a custom configuration (`configurations.shadow`) to specify
runtime dependencies that are *not* merged into the final JAR file.
When configuring publishing with the Shadow plugin, the dependencies in the `shadow`
configuration, are translated to become `RUNTIME` scoped dependencies of the
published artifact.

No other dependencies are automatically configured for inclusion in the POM file.
For example, excluded dependencies are *not* automatically added to the POM file or
if the configuration for merging are modified by specifying
`shadowJar.configurations = [configurations.myconfiguration]`, there is no automatic
configuration of the POM file.

This automatic configuration occurs _only_ when using the above methods for
configuring publishing. If this behavior is not desirable, then publishing *must*
be manually configured.

0 comments on commit 9696c4a

Please sign in to comment.