Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support project dependencies in the shadow configuration #543

Merged
merged 2 commits into from
Feb 2, 2020

Conversation

ejjcase
Copy link

@ejjcase ejjcase commented Jan 27, 2020

When dependencies in the shadow configuration are project dependencies, expose them in the .pom in the same way as dependencies on external modules.

Use case: a multi-project build that publishes API and implementation in separate jars, where the implementation is a shadow jar and needs a dependency on the API.

Fix for #541.

@johnrengelman johnrengelman merged commit d4e649d into GradleUp:master Feb 2, 2020
@johnrengelman johnrengelman added this to the 6.0 milestone Mar 7, 2020
@vlsi
Copy link

vlsi commented Jun 16, 2020

I'm afraid the change looks strange.

Can you please clarify what is the point of manually adding a module to the generated pom?
Every time you edit pom.xml it creates a discrepancy between the published pom.xml and Gradle Metadata.

So if you want something to appear (or disappear) in pom.xml, it should be implemented with altering the relevant Gradle configurations rather than edits to the pom.xml string. That would ensure pom.xml does not contradict metadata file.

@ejjcase ejjcase deleted the shadow-project-dependencies branch June 16, 2020 20:26
@ejjcase
Copy link
Author

ejjcase commented Jun 16, 2020

Hmm, it should probably use SoftwareComponentFactory to create a new component to publish. However, SoftwareComponentFactory (and Gradle Module Metadata) didn't exist until Gradle 5.3, and this code was written to support older Gradle versions.

But shadow now requires Gradle 6, so it could be changed now.

This seems like a new bug to me, introduced by the availability of a new form of metadata.

@johnrengelman
Copy link
Collaborator

Yeah, I'm trying to navigate the various patterns here. I previously had create my own "component" using the shadow.component method because SoftwareComponent wasn't public API.

ejona86 added a commit to ejona86/grpc-java that referenced this pull request Jun 7, 2021
GradleUp/shadow#543 fixed project support,
which means the workaround is no longer necessary.
ejona86 added a commit to grpc/grpc-java that referenced this pull request Jun 11, 2021
GradleUp/shadow#543 fixed project support,
which means the workaround is no longer necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants