title: substring a variable in pom.xml
body: <p>Is it possible (and how) to substring a variable in the pom.xml, or the properties that uses this variable?</p>
  
  <p><strong>My scenario:</strong></p>
  
  <p>I have a swing application that shows a kind of version in its footer.
  This version is read from a properties file.
  The properties file only have a reference for a maven variable, as:</p>
  
  <pre><code>version=${git.branch}
  </code></pre>
  
  <p>In my pom.xml, a have a plugin that looks for the branch name, and write it in the "git.branch" variable.</p>
  
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.7.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;pl.project13.maven&lt;/groupId&gt;
              &lt;artifactId&gt;git-commit-id-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.2.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;dotGitDirectory&gt;${project.basedir}/../.git&lt;/dotGitDirectory&gt;
                  &lt;injectAllReactorProjects&gt;true&lt;/injectAllReactorProjects&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;get-the-git-infos&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;revision&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/resources&lt;/directory&gt;
              &lt;filtering&gt;true&lt;/filtering&gt;
              &lt;includes&gt;
                  &lt;include&gt;**/version.properties&lt;/include&gt;
              &lt;/includes&gt;
          &lt;/resource&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/resources&lt;/directory&gt;
              &lt;filtering&gt;false&lt;/filtering&gt;
              &lt;excludes&gt;
                  &lt;exclude&gt;**/version.properties&lt;/exclude&gt;
              &lt;/excludes&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>But now we are using a prefix for the branch names, and this prefix shouldn't be deployed with the application version.</p>
  
  <p>I had branches like:</p>
  
  <pre><code>v123
  v124
  v125
  </code></pre>
  
  <p>Now I have branches like:</p>
  
  <pre><code>b_04_v123
  b_04_v124
  </code></pre>
  
  <p>And i want maven to get only the value "v124" of the string "b_04_v123", the prefix is fixed, aways like "b_NN_".</p>
  
  <p>NOTE: No, it's not possible to change the branch names, as other departments uses them with scripts and automation.</p>