A quick poll before I open an issue: do Maven and ...
# general
c
A quick poll before I open an issue: do Maven and Ivy coordinates occupy the same namespace? Is: •
groupId
===
organization
artifactId
===
module
version
===
revision
Or in more direct Gradle speak, should Ivy and Maven publish plugins share a single
ModuleVersionIdentifier
interface, or should we have distinct:
IvyModuleVersionIdentifier
and
MavenModuleVersionIdentifier
types?
👍 1
j
I would like a refactor for this, I asked something very similar to @melix because current naming is not matching the same than the naming in version catalogs
l
They should share the same
ModuleVersionIdentifier
as you use the same basic notation to reference an artifact from both repos.
m
what Louis said. a
ModuleVersionIdentifier
= a module + a version. A module is (groupId,artifactId) in maven, (org,module) in Ivy. But the concept is the same.
c
My issue is that I need to publish the same artifact to two different repositories - one ivy and one maven. The two repositories use two different version number schemes (essentially the same numbers but different textual formatting) - but since Gradle considers these two repositories to share a single namespace it cannot correctly resolve which version number format to use to write the dependency.
It’s another variant of https://github.com/gradle/gradle/issues/1061 - I would argue the fix I want/need is that Gradle should not consider this ambiguous if the dependent project has a publication whose target repo matches the depending project.
m
Different coordinates on different repos? wow... this looks like self inflicted wounds 😕 I don't think there's a good pattern for this, this is doomed to cause problems (think of composite builds recognition of components, etc.).
f
But it should be solvable with Gradle by having like 3 sub-projects where 1 contains the code and the other 2 are only for publishing. This way you can do whatever without getting in each others way.
c
@melix this is enterprise software…. the wounds aren’t self inflicted they’re inflicted by other teams. That said the conversion is to the coordinate system of a given repository… Gradle should be able to take in to account the target repository when doing the conversion/resolving. If I were to submit a PR modifying
ProjectDependencyPublicationResolver
(and it’s implementations) to resolve this ambiguity (resolve based on target repo) would that be entertained as an idea?
m
Unfortunately I can't tell, this code is messy and I'm not familiar with it.