title: Maven - pass argument to use in exec-maven-plugin
body: <p>in my pom I've added the exec-maven-plugin to call a java class which will generate a file. This class requires some parameters to be passed to the main method, one of those is the location of an input file (outside the project). Until now I've been using a relative path for this which works fine:</p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;test&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;java&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;mainClass&gt;com.laco.projectmaster.util.LanguageGenerator&lt;/mainClass&gt;
                  &lt;arguments&gt;
                      &lt;argument&gt;../PM-Config/dev/PMLanguage.xls&lt;/argument&gt;
                      &lt;argument&gt;PM4.0&lt;/argument&gt;
                      &lt;argument&gt;${project.build.outputDirectory}/com/laco/projectmaster/props/resources&lt;/argument&gt;
                      &lt;argument&gt;ProjectMaster&lt;/argument&gt;
                      &lt;argument&gt;Created during maven build (POM Version: ${pom.version})&lt;/argument&gt;
                  &lt;/arguments&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>Now I'm starting to use hudson to install/package and deploy the wars and I cannot longer use this relative path. Simple I thought, I just pass the location of the input file when invoking maven like:  </p>
  
  <p><em>mvn clean package -Dlangdir=C:/somedir</em>  </p>
  
  <p>and then alter the pom like:  </p>
  
  <pre><code>&lt;argument&gt;${langdir}/PMLanguage.xls&lt;/argument&gt;
  </code></pre>
  
  <p>However, this parameter simply gets ignored here. The path the main class receives as argument becomes <em>null/PMLanguage.xls</em> . The parameter itself is available in maven, I tested with succes using an echo in the antrun plugin. The correct path was echoed.</p>
  
  <p>Are the paremeters you pass to maven then not available by default no matter where you reference them in the pom? </p>
  
  <p>thanks for any help,<br>
  Stijn</p>