title: How can I update a property in a Maven POM?
body: <p>I have two top-level Maven projects, <code>backend</code> and <code>frontend</code>, that advance versions at their own individual pace. Since each has multiple modules, I define my dependency versions in <code>dependencyManagement</code> sections in the parent/aggregate POMs and use a property for the version number.</p>
  
  <p>I want to cleanly update the property with the version number on <code>frontend</code>, preferably arbitrarily, but I can live with requiring a live upstream version to match. I've tried using <a href="http://mojo.codehaus.org/versions-maven-plugin/examples/update-properties.html" rel="noreferrer"><code>versions:update-property</code></a>, but that goal seems to be completely non-functional; regardless of whether there's actually a matching upstream version, I get this debug output:</p>
  
  <pre><code>$ mvn versions:update-property -Dproperty=frontend.version -DnewVersion=0.13.2  -DautoLinkItems=false -X
  ...
  [DEBUG] Searching for properties associated with builders
  [DEBUG] Property ${frontend.version}
  [DEBUG] Property ${frontend.version}: Looks like this property is not associated with any dependency...
  [DEBUG] Property ${frontend.version}: Set of valid available versions is [0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.13.2, 0.13.3]
  [DEBUG] Property ${frontend.version}: Restricting results to 0.13.2
  [DEBUG] Property ${frontend.version}: Current winner is: null
  [DEBUG] Property ${frontend.version}: Searching reactor for a valid version...
  [DEBUG] Property ${frontend.version}: Set of valid available versions from the reactor is []
  [INFO] Property ${frontend.version}: Leaving unchanged as 0.13.1
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>I've specified <code>-DautoLinkItems=false</code>, and this appears to have no effect; <code>versions-maven-plugin</code> still scans all of my POMs for matching dependencies, throws up its hands, and quits. I've also tried setting <code>searchReactor</code> to <code>false</code> for that property in the plugin configuration. It appears that the plugin (1) incorrectly scans the dependencies even when I've explicitly said to ignore them and (2) even filters out an explicit specific match.</p>
  
  <p>Is there a simple way to rewrite a Maven property entry to a specific value, either forcing <code>versions-maven-plugin</code> to do what I say without validating for a version number or by using another goal? I'd prefer to avoid a tool like <code>sed</code> that doesn't understand XML (as I've seen recommended in a similar question), but I would be okay with a simple XPath manipulation.</p>