How to access Maven artifacts timestamp and buil-number from Bamboo?

34 Views Asked by At

With Maven 3.3.9 and using Bamboo for a build pipeline, for a given project version (e.g., 2.3.0-SNAPSHOT), once the artifacts are pushed to Nexus, the name looks like my-project-2.3.0-20231009.065059-2.jar.

Where do the 20231009.065059 and the 2 come from? From Maven or Bamboo? I'd like to access them from a later stage of the Bamboo pipeline, but I don't know whether they are already accessible through a variable, or if there's a way to make them accessible.

1

There are 1 best solutions below

0
Alex On

This is because you're using a -SNAPSHOT version for your maven artifact. Maven repositories ornament such artifacts with extra filename suffixes so that they can keep more iterations of them. This is outlined in Maven metadata docs and becomes clearer if you look at the example metadata file and how it points to only the latest iteration.

Having said this, the way to consume such snapshot artifacts is using Maven itself, e.g. dependency:get. Alternatively, register the artifact and download it from another stage/deployment without going through Nexus.