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

maven-publish doesn't play well with -apollo modules generated when generateApolloMetadata is used #4350

Closed
benoitletondor opened this issue Aug 19, 2022 · 5 comments

Comments

@benoitletondor
Copy link

benoitletondor commented Aug 19, 2022

Summary

When trying to publish a new version of our SDK with a :core module having a service using generateApolloMetadata and another module ( :messaging-core ) depending on that module, we ran into an issue preventing the build:

Could not determine the dependencies of task ':messaging-core:publishReleasePublicationToMavenLocal'.
> Publishing is not able to resolve a dependency on a project with multiple publications that have different coordinates.
  Found the following publications in project ':core':
    - Maven publication 'release' with coordinates xxx.xxx.sdk:core:y
    - Maven publication 'apollo' with coordinates xxx.xxx.sdk:core-apollo:y

Version

3.5.0

Logs

https://jitpack.io/com/github/nabla/nabla-android/2a1f725fb6/build.log

More details

This is not an apollo issue, more of a gradle/maven plugin one, more details in the gradle issue: gradle/gradle#1061

We found a workaround setting apollo modules as alias: https://github.com/nabla/nabla-android/blob/main/core/build.gradle#L95

@benoitletondor benoitletondor changed the title maven-publish doesn't play well with -apollo module generated when generateApolloMetadata is used maven-publish doesn't play well with -apollo modules generated when generateApolloMetadata is used Aug 19, 2022
@martinbonnin
Copy link
Contributor

Good catch. It's exactly this Gradle issue: gradle/gradle#16123

I'm a bit puzzled what the best fix for this is. Maybe we could "just" publish the apolloMetadata.json as part of the default publication. I didn't want to do this initially because that's touching the user publication but it might be an easier setup ultimately.

Something else we could look into is the Kotlin multiplatform plugin. They typically publish several publication at different coordinates and it looks like it's working fine 🤔 . So maybe there's some inspiration to get from there.

@martinbonnin
Copy link
Contributor

For the record, v4 will only expose a Gradle software component and let users configure publications as needed and should therefore fix this issue.

@martinbonnin
Copy link
Contributor

@benoitletondor any chance you could try the v4 snapshots? Did it fix this issue?

@benoitletondor
Copy link
Author

Hey @martinbonnin , very sorry but my company (and myself) moved to another project where we don't use Apollo Kotlin anymore so I don't have a way of testing that right now :( very sorry

@martinbonnin
Copy link
Contributor

No worries, thanks for the quick reply!

I'll close it for now and reopen if that ever becomes an issue again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants