This message was deleted.
# dependency-management
s
This message was deleted.
o
why are you unable to change the project name?
this is something that should wire up via whatever is used in `maven-publish`'s
publishing
block -- but there is no immediate reason I see that you could not try changing the project name if that way isn't working
m
This flag might be on or off, in fact I could change the name in settings but then I also have to conditionally change the dependency, sometimes project(“:B”) and sometimes project(“:B-suffix”) depending on the flag. Maybe it’s possible but it doesn’t feel right to me, I’m not sure. Now B’s artifact is changed in maven-publish configuration as you said, but it’s not automatically picked up by A. Should it be? Or how do I? Thanks!
o
can you share `B`'s `build.gradle`(
.kts
)?
or rather, the place where you are configuring the artifact ID
m
It’s a bit complex 😅 I use this plugin, applied by some other plugin... it exposes an
artifactId
property which gets later passed to the maven publication. Does A’s
maven-publish
look into B’s maven publications for this wiring? And how does it match the right publication? I probably have more than one
o
The exact logic is in https://github.com/gradle/gradle/blob/401c31af0193c7deaf5e6e5853d2a20ac632df5e/sub[…]/projectmodule/DefaultProjectDependencyPublicationResolver.java ; looking at the plugin it seems like it should get set in time to wire up here without issues, but it's too complex for me to be sure. I would debug the configuration via https://docs.gradle.org/current/userguide/troubleshooting.html#sec:troubleshooting_build_logic , add a breakpoint in this method (for when
project.getName().equals("B")
), and see what it thinks the artifact id is and how it got there.
m
That's very helpful, thank you! I will investigate deeper and see what's happening.