I am trying to use (partly successfully) the versions-maven-plugin to retrieve latest release/snapshot versions from my local and nexus repositories to update maven projects. When running this plugin to update versions, I have noticed the following behaviour:
Even though I know that there is a newer version in nexus, but not in my local repository, it doesn't find the latest version, but the latest from the local repo. If I delete all the maven-metadata*.xml files from my local repo for the artifact I want to update, it downloads the latest maven-metadata*.xml files and correctly finds the latest version.
I see that it's using 2.0.6 og all maven APIs, and the method that drives the whole update mechanism is retrieveAvailableVersions() from interface ArtifactMetadataSource and implemented by MavenMetadataSource.
MY QUESTION How can I alter the code of this plugin to always download the latest maven-metadata*.xml files such that I get the latest versions? Or if there is any other reliable method which can make this happen..
Thanks for your time.
I have actually found the solution myself and created a goal which I run before running goals which updates my pom.xml files: This is the method which updates the metadata for all repositories. If you need the whole goals, please let me know: