Can anyone think of a clever mechanism by which I can retrieve the maven snapshot version (timestamp & build number) of an artifact that was published by the build?
v
Vampire
04/22/2025, 1:22 PM
Resolve it after the publishing using a detached configuration maybe? Or just download the according
maven-metadata.xml
and look inside?
c
Chris
04/22/2025, 1:27 PM
the resolving makes sense... I hadn't thought about doing that... I explored the maven-metadata concept but it gets a bit ugly
Chris
04/22/2025, 1:28 PM
I'd love there to be a way to do this without having to roundtrip things but that is the way of things
v
Vampire
04/22/2025, 2:01 PM
The timestamp is constructed by Gradle when publishing, but I don't think it is available in any way, especially not through public API.
c
Chris
04/22/2025, 2:05 PM
The timestamp is actually the "build started" time which can be returned via the right service injection. It's the build number that's hard. Gradle is doing a metadata fetch internally and then picking the next build number. I'd love to avoid a repeat of that remote call, but I think it's going to be necessary.