title: How to get maven version number inside POM
body: <p>I need to get maven version number (e.g. 3.0.5, 3.1.0) from inside pom.xml file I need it to be able to add correct dependencies for:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
      &lt;artifactId&gt;maven-model&lt;/artifactId&gt;
      &lt;version&gt;3.0.5&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
      &lt;artifactId&gt;maven-plugin-api&lt;/artifactId&gt;
      &lt;version&gt;3.0.5&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Version 3.1.0 requires the libraries at the same version, same for 3.0.5.
  I would assume that there has to be something like <code>${maven.version}</code> in poms but I couldn't find it.</p>
  
  <p>EDIT:
  I need the project to work in both maven 3.0 and 3.1 so I can't do it statically it has to get the version of currently running maven</p>