title: how do I tell maven to update the local metadata?
body: <p>I'm trying to understand how to get maven to update the local maven-metadata-local.xml file, by checking what artifact versions are available in our maven repository, and updating the <code>release</code> tag in the local metadata file to the latest version.</p>
  
  <p>My team and I are working on a large codebase consisting of several code modules.  These modules have dependencies on each other.  </p>
  
  <p>For example, the ER_catalog module depends on ER_CORE_api, so in the ER_catalog pom.xml, we declare a dependency on ER_CORE_api, and use the version RELEASE.  </p>
  
  <p>Maven then looks in the local metadata to see what the latest release of ER_CORE_api is, and uses that to compile the code in ER_catalog.</p>
  
  <p>My local version of this metadata file looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;metadata&gt;
  &lt;groupId&gt;com.company.er&lt;/groupId&gt;
  &lt;artifactId&gt;ER_CORE_api&lt;/artifactId&gt;
  &lt;versioning&gt;
  &lt;release&gt;0.562.0&lt;/release&gt;
  &lt;versions&gt;
    &lt;version&gt;0.561.0&lt;/version&gt;
    &lt;version&gt;0.562.0-SNAPSHOT&lt;/version&gt;
    &lt;version&gt;0.562.0&lt;/version&gt;
    &lt;version&gt;0.563.0-SNAPSHOT&lt;/version&gt;
    &lt;version&gt;0.564.0-SNAPSHOT&lt;/version&gt;
   &lt;/versions&gt;
    &lt;lastUpdated&gt;20150513150410&lt;/lastUpdated&gt;
   &lt;/versioning&gt;
  &lt;/metadata&gt;
  </code></pre>
  
  <p>However, my colleague has recently uploaded version 0.563.0 (using the maven release plugin).  So on the repository where the artifact lives, the metadata looks like this:</p>
  
  <pre><code>&lt;metadata&gt;
  &lt;groupId&gt;com.company.er&lt;/groupId&gt;      
  &lt;artifactId&gt;ER_CORE_api&lt;/artifactId&gt;
  &lt;versioning&gt;
  &lt;latest&gt;0.563.0&lt;/latest&gt;
  &lt;release&gt;0.563.0&lt;/release&gt;
  &lt;versions&gt;&lt;version&gt;0.561.0&lt;/version&gt;
  &lt;version&gt;0.562.0&lt;/version&gt;&lt;version&gt;0.563.0&lt;/version&gt;
  &lt;/versions&gt;
  &lt;lastUpdated&gt;20150513122648&lt;/lastUpdated&gt;
  &lt;/versioning&gt;
  &lt;/metadata&gt;
  </code></pre>
  
  <p>My code won't compile, because it is asking the local maven repo for the latest version of ER_CORE_api, and getting 0.562.0 instead of 0.563.0.   How can I trigger a refresh of this metadata (short of deleting the file) ?</p>
  
  <p>NB I know somebody will say that we should be using specific version tags, not RELEASE.  Here's why we are using RELEASE:</p>
  
  <p>We might have 5 modules which depend on ER_CORE_api.  If each of them have a hard-coded version for ER_CORE_api, then when we update ER_CORE_api to a new version, each of those modules must be updated - and then they must all have a new version created too (since they have changed).  This means that every change would trigger a cascade of changes up the dependency tree, which is a lot of work. Plus, there's no easy way to find out which modules depend on the module I've changed.  </p>
  
  <p>When we freeze a release of the application, we put specific versions in the pom.xml files for all modules.</p>