Add support for Shadow plugin component in Maven publishing #200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds automatic shadow component detection with an opt-in feature flag for proper Maven publishing when using the Gradle Shadow plugin. This aligns with Shadow plugin best practices for handling shaded/bundled dependencies vs external dependencies.
Current problem
When using the Shadow plugin to create fat JARs, the current implementation uses components.java for publication, which results in:
In fact, we have explicit
withXmlmaven manipulations to workaround this issueProposed solution
Implemented automatic shadow component detection controlled by feature flag
nebula.publishing.features.detectShadowComponent.enabledthat:com.gradleup.shadowandcom.github.johnrengelman.shadowpluginscomponents.shadowfor publication when flag is enabledimplementationdependencies (with relocation) → bundled in JAR, excluded from POMshadowconfiguration dependencies → external dependencies in POM, not bundledThis was done through feature flag because it is a breaking change and we should give folks time to migrate. We can do our diligence with folks using this at Netflix and then eventually remove the feature flag in a major version of the plugin