'Apache Maven - Downgrading to previous snapshot dependency version is not working

I have a maven project which is injected with a SNAPSHOT dependency 2.0.0-SNAPSHOT which is there in artifactory. Now dependency project's pom version is updated to 2.0.1-SNAPSHOT and it was built (from a jenkins job) and this snapshot is also there in artifactory. So now artifactory has both the versions 2.0.0-SNAPSHOT and 2.0.1-SNAPSHOT and on local m2 repository also both versions are there.

Main project updated the SNAPSHOT dependency to 2.0.1-SNAPSHOT and it is able to see the new changes in 2.0.1-SNAPSHOT.

Now code changes are made in 2.0.0-SNAPSHOT and it was build and updated in artifactory but now when main project reverted back to 2.0.0-SNAPSHOT and built with -U (force update snapshots), it is not able to see new change done in 2.0.0-SNAPSHOT.

Can anyone suggest what could be wrong here ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source