title: Why isn't Maven recognizing my environment variables?
body: <p>I’m Using Maven 3.3.3 on Mac Yosemite with Java 8.  I have defined a variable, JBOSS_HOME, in my /etc/profile file …</p>
  
  <pre><code>JBOSS_HOME=/opt/wildfly-10.0.0.CR2 
  </code></pre>
  
  <p>In my terminal (using bash shell), I can see the value of this variable …</p>
  
  <pre><code>davea$ echo $JBOSS_HOME
  /opt/wildfly-10.0.0.CR2
  </code></pre>
  
  <p>However, when I run my Maven script (from the same shell), I can’t access the value of this variable.  The below </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.8&lt;/version&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;ant-contrib&lt;/groupId&gt;
              &lt;artifactId&gt;ant-contrib&lt;/artifactId&gt;
              &lt;version&gt;20020829&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;create-dodeploy-file&lt;/id&gt;
              &lt;phase&gt;package&lt;/phase&gt;
              &lt;configuration&gt;
                  &lt;target&gt;
                      &lt;taskdef resource="net/sf/antcontrib/antcontrib.properties" /&gt;
                      &lt;property environment="env" /&gt;
                      &lt;echo message="jboss home: ${env.JBOSS_HOME}" /&gt;
  </code></pre>
  
  <p>produces …</p>
  
  <pre><code> [echo] jboss home: ${env.JBOSS_HOME}
  </code></pre>
  
  <p>What gives?  How do I get Maven to recognize my environment variables?</p>