title: Maven project.build.testSourceDirectory property not working from profile
body: <p>I want to make testing for different folders in a maven project and I need to change the maven's <code>project.build.testSourceDirectory</code> property.</p>
  
  <p>I'm using a maven profile for this problem.</p>
  
  <p>My profile looks like this:</p>
  
  <pre><code>&lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;sahi_UI_testing&lt;/id&gt;
          &lt;activation&gt;
              &lt;property&gt;
                  &lt;name&gt;sahiTesting&lt;/name&gt;
                  &lt;value&gt;true&lt;/value&gt;
              &lt;/property&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;maven.test.skip&gt;false&lt;/maven.test.skip&gt;
              &lt;project.build.testSourceDirectory&gt;src/test/java/org/package1/package2/sahi&lt;/project.build.testSourceDirectory&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>The <code>project.build.testSourceDirectory</code> isn't changed, only remains the default <code>/home/username/workspace/projectName/core/src/test/java</code> (I've tested this with <code>maven-antrun-plugin</code> and gives that path).
  <br>
  I have multiple pom.xml in the projects, so in the path I have the ../core/.. folder (this is the project's core pom.xml).</p>
  
  <p><br>
  The maven-antrun-plugin:
  <br></p>
  
  <pre><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.1&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;phase&gt;validate&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;run&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;tasks&gt;
                      &lt;echo&gt;******** Displaying value of property ********&lt;/echo&gt;
                      &lt;echo&gt;${project.build.testSourceDirectory}&lt;/echo&gt;
                      &lt;echo&gt;${maven.test.skip}&lt;/echo&gt;
                  &lt;/tasks&gt;
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p><br></p>
  
  <p>Executing <code>mvn help:active-profiles -f core/pom.xml -Dtest=JavaClientTest -o -e test -DsahiTesting=true</code> with <code>&lt;maven.test.skip&gt;true&lt;/maven.test.skip&gt;</code> in <code>maven-antrun-plugin</code> this gives me:
  <br>
  <b>
  [INFO] Executing tasks<br>
  [echo] <strong><em>*</em>*</strong> Displaying value of property <strong><em>*</em>*</strong><br>
  [echo] /home/username/workspace/projectName/core/src/test/java<br>
  [echo] true<br>
  </b>
  <br>
  and with <code>&lt;maven.test.skip&gt;false&lt;/maven.test.skip&gt;</code> in <code>maven-antrun-plugin</code> this gives me:
  <br>
  <b>
  [INFO] Executing tasks<br>
  [echo] <strong><em>*</em>*</strong> Displaying value of property <strong><em>*</em>*</strong><br>
  [echo] /home/username/workspace/projectName/core/src/test/java<br>
  [echo] false<br>
  </b>
  <br></p>
  
  <p>So, we can see that the another variable was changed.<br></p>
  
  <p>I know that the profile was activated because I used <code>maven-help-plugin</code> to identify this.<br>
  The <code>maven-help-plugin</code> gives me this result:
  <br>
  <b>
  The following profiles are active:</p>
  
  <ul>
  <li>sahi_UI_testing (source: pom)
  </b></li>
  </ul>
  
  <p>I've tried without maven's profile to change the <code>project.build.testSourceDirectory</code> property only in the <code>&lt;build&gt;</code> tag.
  <br></p>
  
  <pre><code>...
  &lt;build&gt;
      &lt;testSourceDirectory&gt;src/test/java/org/package/package2/sahi&lt;/testSourceDirectory&gt;
      ...
  &lt;/build&gt;
  </code></pre>
  
  <p>There the property was changed (but I need to assign more than one value to that property).
  I've tried the <code>maven-surefire-plugin</code> and doesn't work too.</p>
  
  <p>The question is that why the <code>project.build.testSourceDirectory</code> isn't changed when using the profile?</p>