title: Change source directory in profile maven
body: <p>I want to use a different source directory for a specific maven profile, however, when I try to specify it in the profile definition I get this error:</p>
  
  <pre><code>Unrecognised tag: 'sourceDirectory' (position: START_TAG seen ...&lt;build&gt;\r\n\t\t\t\t&lt;sourceDirectory&gt;... )
  </code></pre>
  
  <p>The definition in the pom is as follows:</p>
  
  <pre><code>&lt;profile&gt;
      &lt;id&gt;development&lt;/id&gt;
      &lt;build&gt;
          &lt;sourceDirectory&gt;${project.build.directory}/new-src&lt;/sourceDirectory&gt;
          .
          . 
          .
      &lt;/build&gt;
  &lt;/profile&gt;
  </code></pre>
  
  <p>What I am trying to do is to process the source files before its compilation if and only if this profile is active. My process will change the source files on the fly, throw the changed sources in the "new-src" directory and compile that directory as if it was the usual "src/main/java". Everything else in the lifecycle should behave normally. If this approach is flawed, could anyone point me into the right direction?</p>