This message was deleted.
# community-support
s
This message was deleted.
✔️ 1
m
@Chris
m
Do you know of a specific example? This seems like a lot to go through to simply change a version or few. The component I want to publish is the java component, just with these version changes.
m
Any change to a
pom.xml
file is a code smell IMO. So either it means you have custom publications and they should be modeled as such, or it means that the initial declarations were wrong. I cannot really tell from what you are explaining. Maybe there's another way for your particular use case.
v
Also you asked "What is the proper way" and the answer is exactly what Cédric said, fix your model so that the generated files are what you expect / need. For the Gradle module metadata also no equivalent like
withXml
exists because you are not supposed to manipulate it but to fix your model. The only way to still hack-around (still, because
withXml
also imo is bad), would be to register some
doLast
action on the generation task that then modifies that actual generated file. But really, better fix your model so that the generated file is what you expect / need.
m
The dev teams are fixing the underlying issue and as I originally said, I know that this is a workaround. Specifically, we have projects that have cyclic dependencies among them and the workaround references a previous publication, and then the local jar file on subsequent builds. This later workaround custom resolver. Unfortunately, the workaround attributes are being used in publishing the pom/metadata and needs to be corrected. This workaround has been used for several years and has worked for our build because transitive dependencies have not been enabled. Now we are enabling transitive dependencies and the published dependencies are incorrect in this case. In summary, I agree that there is an issue with the component model itself. But, for now it is what it is and I am looking for the best way to modify the metadata to be proper for our (probably unique) situation.
m
m
That is what is already done. And this resolved version is the one that is incorrect.
m
instead of
fromResolutionResult()
, you could use
fromResolutionOf(yourConfiguration)
, and have your configuration something which extends, say,
runtimeClasspath
, and defines its own resolution strategy rules
configurations.yourConfiguration.resolutionStrategy { ... do the substitutions here ... }
.
m
This is a possibility that seems worth attempting. I will give it a try and let you know if it works for our case. Thanks
👌 1
Setting up a new configuration extending from runtimeClasspath (resolved versions are used from here for the other dependencies) and setting up the proper substitution in the resolutionStrategy worked as desired. Thanks for the help
👌 1
v
Maybe you want to also post your solution to the forum. 🙂