title: How access a variable with Groovy Plugin in Maven
body: <p>I have an application with React in a children module and I'd like use the node.exe which exist in the parent module.</p>
  
  <p>In Parent POM I defined a variable with path of the node.exe </p>
  
  <pre><code>&lt;properties&gt;
      &lt;project.name&gt;Corretor Online&lt;/project.name&gt;
      &lt;nodeBase&gt;C:/col/COL&lt;/nodeBase&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  </code></pre>
  
  <p>Obs.: I'd like to use ${project.basedir} in nodeBase Variable</p>
  
  <p>And I try to access these variable in children POM to pass as parameter in ProcessBuilder method:</p>
  
  <pre><code>&lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.groovy.maven&lt;/groupId&gt;
              &lt;artifactId&gt;gmaven-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;webpack&lt;/id&gt;
                      &lt;phase&gt;process-resources&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;execute&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;source&gt;&lt;![CDATA[
                                  println "Compiling client code..."
                                  def webpack = new ProcessBuilder(["" + nodeBase + "/node/node", "" + nodeBase + "/node_modules/webpack/bin/webpack.js", "-p", "&amp;#45;&amp;#45;progress", "&amp;#45;&amp;#45;bail"]).inheritIO().directory(project.getBasedir())
                                  def env = webpack.environment()
                                  env.put("WAR_NAME", project.build.finalName)
                                  def proc_webpack = webpack.start()
                                  proc_webpack.waitForOrKill(120000)
                                  if(proc_webpack.exitValue() != 0)
                                      throw new org.apache.maven.plugin.MojoFailureException("Error compiling client code")
                              ]]&gt;&lt;/source&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>But I recive this error:</p>
  
  <blockquote>
    <p>[ERROR] Failed to execute goal org.codehaus.groovy.maven:gmaven-plugin:1.0:execute (webpack) on project col-backoffice-war: groovy.lang.MissingPropertyException: No such property: nodeBase for class: script1539714060887 -> [Help 1]</p>
  </blockquote>
  
  <p>And If I change from "nodeBase" to "${nodeBase}, I recive this error:</p>
  
  <blockquote>
    <p>[ERROR] Failed to execute goal org.codehaus.groovy.maven:gmaven-plugin:1.0:execute (webpack) on project col-backoffice-war: startup failed, script1539714572018.groovy: 2: unexpected char: '#' @ line 2, column 134.</p>
  </blockquote>
  
  <p>However, If I put the literal path, I can build.</p>
  
  <pre><code>def webpack = new ProcessBuilder(["C:/col/COL/node/node", 
  "C:/col/COL/node_modules/webpack/bin/webpack.js", "-p", 
  "&amp;#45;&amp;#45;progress", 
  "&amp;#45;&amp;#45;bail"]).inheritIO().directory(project.getBasedir())
  </code></pre>
  
  <p>I couldn't find the solution for it, may you help with how I can access this variable?</p>
  
  <p>Thanks very much!</p>