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

**URL:** <https://community.sonatype.com/t/what-is-the-differences-between-maven-baseversion-and-maven-version/2937>\
**Category:** Sonatype Nexus Repository\
**Tags:** nexus-repository\
**Created:** [November 14, 2019, 3:15am UTC](https://community.sonatype.com/t/what-is-the-differences-between-maven-baseversion-and-maven-version/2937 "2019-11-14T03:15:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wangdonghui](https://avatars.discourse-cdn.com/v4/letter/w/e19adc/32.png) [@wangdonghui](https://community.sonatype.com/u/wangdonghui)\
**Post date:** [November 14, 2019, 3:15am UTC](https://community.sonatype.com/t/what-is-the-differences-between-maven-baseversion-and-maven-version/2937/1 "2019-11-14T03:15:27Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![rseddon](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/rseddon/32/341_2.png) [@rseddon](https://community.sonatype.com/u/rseddon)\
**Post date:** [November 14, 2019, 2:03pm UTC](https://community.sonatype.com/t/what-is-the-differences-between-maven-baseversion-and-maven-version/2937/2 "2019-11-14T14:03:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wangdonghui](https://avatars.discourse-cdn.com/v4/letter/w/e19adc/32.png) [@wangdonghui](https://community.sonatype.com/u/wangdonghui)\
**Post date:** [November 15, 2019, 2:42am UTC](https://community.sonatype.com/t/what-is-the-differences-between-maven-baseversion-and-maven-version/2937/3 "2019-11-15T02:42:10Z")

</div>

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

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/communitysonatype/original/1X/39d5fd299c625578c50077950d8a0ae2dfd09140.png)

---

<div class="post-metadata">

**Author:** ![rseddon](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/rseddon/32/341_2.png) [@rseddon](https://community.sonatype.com/u/rseddon)\
**Post date:** [November 15, 2019, 3:24pm UTC](https://community.sonatype.com/t/what-is-the-differences-between-maven-baseversion-and-maven-version/2937/4 "2019-11-15T15:24:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wangdonghui](https://avatars.discourse-cdn.com/v4/letter/w/e19adc/32.png) [@wangdonghui](https://community.sonatype.com/u/wangdonghui)\
**Post date:** [November 20, 2019, 3:25am UTC](https://community.sonatype.com/t/what-is-the-differences-between-maven-baseversion-and-maven-version/2937/5 "2019-11-20T03:25:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rseddon](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/rseddon/32/341_2.png) [@rseddon](https://community.sonatype.com/u/rseddon)\
**Post date:** [November 20, 2019, 3:08pm UTC](https://community.sonatype.com/t/what-is-the-differences-between-maven-baseversion-and-maven-version/2937/6 "2019-11-20T15:08:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wangdonghui](https://avatars.discourse-cdn.com/v4/letter/w/e19adc/32.png) [@wangdonghui](https://community.sonatype.com/u/wangdonghui)\
**Post date:** [November 21, 2019, 7:16am UTC](https://community.sonatype.com/t/what-is-the-differences-between-maven-baseversion-and-maven-version/2937/7 "2019-11-21T07:16:51Z")

</div>

@rseddon  
Thanks for your reply~
