Problem about snapshots metadata.xml

when I deploy snapshot-jar to a snapshots-repo,some problem occued:
when I deploy the the 5th version and the 6th version , the metadata.xml is always the 4th version,so, when I download the snapshot-jar,I always download the 4th version,not the latest one,the metadata.xml like this:

<groupId>com.yonyou.cyx</groupId>
<artifactId>base-client</artifactId>
<version>1.8.0-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20211114.235047</timestamp>
<buildNumber>18</buildNumber>
</snapshot>
<lastUpdated>20211114235047</lastUpdated>
<snapshotVersions>
<snapshotVersion>
<extension>pom</extension>
<value>1.8.0-20190515.065415-4</value>
<updated>20211114235047</updated>
</snapshotVersion>
<snapshotVersion>
<extension>jar</extension>
<value>1.8.0-20190515.065415-4</value>
<updated>20211114235045</updated>
</snapshotVersion>
<snapshotVersion>
<classifier>sources</classifier>
<extension>jar</extension>
<value>1.8.0-20190515.065415-4</value>
<updated>20211114235043</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>
</metadata>

I try to do below methods ,but not useful
(1) rebuild maven repo metadata—not useful
(2) delete all the snapshots version and upload again,the metadata.xml is always the 4th version,Even if there is only one version assets—not useful

so, what should I do?

my deploy command is like: mvn deploy:deploy-file -DgroupId=com.xxx.xxx -DartifactId=xxx-xxx -Dversion=1.8.0-20190620.090931-7 -Dfile=/root/base-client-1.8.0-20190620.090931-7.pom -Durl=http://localhost:8081/repository/maven_nexus2_snapshots/ -DrepositoryId=nexus-snapshots --settings /usr/local/maven3.6/conf/settings.xml


my deploy command is like: mvn deploy:deploy-file -DgroupId=com.xxx.xxx -DartifactId=xxx-xxx -Dversion=1.8.0-20190620.090931-7 -Dfile=/root/base-client-1.8.0-20190620.090931-7.pom -Durl=http://localhost:8081/repository/maven_nexus2_snapshots/ -DrepositoryId=nexus-snapshots --settings /usr/local/maven3.6/conf/settings.xml

I’m afraid you’re misusing Maven, that’s not the right way to deploy a snapshot. You should let maven compute the next version number, so you should use “-Dversion=1.8.0-SNAPSHOT”. Maven will calculate the next timestamp and build number.

Rich

Thank you for your reply, I delete all the old version and use your way to deploy,the build number and snapshots’ timestamp is right , but , the build number in the metadata.xml is still 4, I guess the metadata.xml do not delete completely,no matter how I delete the assets or deploy,The contents of the meatadata.xml is never updated.
but if I change the artifactId or groupId,such as , I change artifactid xxx to yyy,the metadata.xml is updated, and other snapshots assets is work normally, only this one when use origin artifactId and groupId,the metadata.xml not update。
so , is this a bug?