What is the differences between maven.baseVersion and maven.version?

I’m using Nexus Repository Mannager 3, I noticed that maven attributes has a attribute which named baseVersion.
And when search the compoments by maven coordinates, the version attribute doesn’t work when the version contains SNAPSHOT.
So I want to know the differences between maven.baseVersion and maven.version.
Thanks!

For release versions the maven.version and maven.baseVersion are the same. For snapshots, the maven.version is the timestamped version number, and the maven.baseVersion is the raw snapshot version (e.g. 1.2.3-SNAPSHOT). Search works against the base version, and will return all timestamped snapshots that match the base version.

Rich

1 Like

When I search using maven.baseVersion, it only return the latest one.
In fact there are 3 timestamped snapshots, the screen as follows:

The UI will select the highest timestamped snapshot version when you search for the base version. But it does show you all the other versions, since the tree is expanded.

1 Like

I’m not understand why there are two attributes: baseVersion and version.
I think one attribute is enough, two attributes increase the cost of use.

It’s for maven snapshots. The base version is the one with “-SNAPSHOT” in the name. That is the version you’d typically put in pom files as a dependency. The timestamped snapshot is the one that has the timestamp and build number, referring to a specific snapshot.

A maven base snapshot version of “project-1.1.4-SNAPSHOT”, will have files with versions like “project-1.1.4-20180227.152032-1.jar” deployed within it.

This is specific to maven, which is why other formats (such as npm) have only a version, there is no need for baseversion in those.

@rseddon
Thanks for your reply~