Nexus is not overwriting artefacts when deploying new version

Hi there, we were running a 2021 version of Nexus Repo Community. We have a repository of type “hosted” where we deploy some artefacts to. Currently, there is an artefact which i want to overwrite with new revision. I push with the same version tag via this command:

mvn deploy:deploy-file ^
  -DgroupId=org.zkoss.zkforge ^
  -DartifactId=ckez ^
  -Dversion=4.21.0.0-jakarta ^
  -Dpackaging=jar ^
  -Dfile=ckez-4.21.0.0-jakarta.jar ^
  -DpomFile=ckez-4.21.0.0-jakarta.pom ^
  -DrepositoryId=nexus ^
  -Durl=https://myuser:myPass@server01:8444/repository/maven-releases/

When I look into the .pom on the nexus, I can see that it’s not the same content of the .pom that I just deployed. When I delete this artefact on the server entirely and do another deploy, then Nexus brings back the old revision that I just deleted instead the version I just deployed. Only when I assign a new version tag, the deployed version is shown in Nexus under the new version tag.

Am I doing something wrong?

Best thing to do would be to look carefully at the logs of both your maven run and of Nexus. What do each of those tools think happened? You may see things in the request log that indicate an overwrite was rejected, as that’s a common setting for hosted repositories.

You may know that it’s normally an anti-pattern to reuse release version numbers for different artifacts, because that undermines build repeatability. Especially once you get into distribution of those artifacts through various proxy or user caches, it becomes hard to know if a given build used the “wrong” version, the “right” version, the new “right” version, or the new new “right” version of 4.21.0

As a further aside, we strongly recommend you not run versions of Repository that old. They were sunset ages ago, and contain an accumulation of vulnerabilities that make them insecure.