title: Why does Apache Maven change the compileSourceRoots default value?
body: <p>I have copied my pom  based application project into another directory 
  and built the original project with the paraneters <code>compile deploy</code>. </p>
  
  <p>Maven's  default value of <code>compileSourceRoots</code> is <code>[projectname]\src\java</code> which is fine.</p>
  
  <p>Maven's output: </p>
  
  <pre><code>[DEBUG]   (f) compileSourceRoots = [D:\ccviews\ovandunen_main\TWCS_HEN\wcg\source\Common\src\main\java]
  </code></pre>
  
  <p>If I change the directory of the copied project and run <code>mvn compile deploy</code>  I get a different <code>compileSourceRoots</code> value which is <code>[projectname]\src\test\java</code>.</p>
  
  <p>Maven's output:</p>
  
  <pre><code>[DEBUG]   (f) compileSourceRoots = [D:\ccviews\ovandunen_loesch\TWCS_HEN\wcg\source\Common\src\test\java]
  </code></pre>
  
  <p>Why and when does Maven change its default value?</p>
  
  <p>This the pom:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  
      &lt;parent&gt;
          &lt;groupId&gt;com.org.eth&lt;/groupId&gt;
          &lt;artifactId&gt;WaysideGateway&lt;/artifactId&gt;
          &lt;version&gt;1.3.0.0&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;groupId&gt;com.org.eth&lt;/groupId&gt;
      &lt;artifactId&gt;Common&lt;/artifactId&gt;
      &lt;version&gt;1.3.2.1&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;Common&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.6&lt;/source&gt;
                      &lt;target&gt;1.6&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;url&gt;http://download.eclipse.org/rt/eclipselink/maven.repo/&lt;/url&gt;
              &lt;id&gt;eclipselink&lt;/id&gt;
              &lt;layout&gt;default&lt;/layout&gt;
              &lt;name&gt;Repository for library Library[eclipselink]&lt;/name&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.jboss.arquillian&lt;/groupId&gt;
                  &lt;artifactId&gt;arquillian-bom&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0.Final&lt;/version&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
                  &lt;type&gt;pom&lt;/type&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.arquillian.junit&lt;/groupId&gt;
              &lt;artifactId&gt;arquillian-junit-container&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;eclipselink&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;!---
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;javax.persistence&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;org.eclipse.persistence.jpa.modelgen.processor&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.ant&lt;/groupId&gt;
              &lt;artifactId&gt;ant&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;postgresql&lt;/groupId&gt;
              &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.transaction&lt;/groupId&gt;
              &lt;artifactId&gt;jta&lt;/artifactId&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.validation&lt;/groupId&gt;
              &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
              &lt;version&gt;1.1.0.Alpha1&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;arquillian-glassfish-embedded&lt;/id&gt;
              &lt;activation&gt;
                  &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;/activation&gt;
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.jboss.arquillian.container&lt;/groupId&gt;
                      &lt;artifactId&gt;arquillian-glassfish-embedded-3.1&lt;/artifactId&gt;
                      &lt;version&gt;1.0.0.CR3&lt;/version&gt;
                      &lt;scope&gt;test&lt;/scope&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.glassfish.main.extras&lt;/groupId&gt;
                      &lt;artifactId&gt;glassfish-embedded-all&lt;/artifactId&gt;
                      &lt;version&gt;3.1.2&lt;/version&gt;
                      &lt;scope&gt;provided&lt;/scope&gt;
                  &lt;/dependency&gt;
                  &lt;!-- Enable dependency if you want to use H2 --&gt;
                  &lt;!-- Also update glassfish-resources.xml to use H2 connection information --&gt;
                  &lt;!--
                   &lt;dependency&gt;
                       &lt;groupId&gt;com.h2database&lt;/groupId&gt;
                       &lt;artifactId&gt;h2&lt;/artifactId&gt;
                       &lt;version&gt;1.3.166&lt;/version&gt;
                       &lt;scope&gt;test&lt;/scope&gt;
                   &lt;/dependency&gt;
                  --&gt;
              &lt;/dependencies&gt;
              &lt;build&gt;
                  &lt;testResources&gt;
                      &lt;testResource&gt;
                          &lt;directory&gt;src/test/resources&lt;/directory&gt;
                      &lt;/testResource&gt;
                      &lt;testResource&gt;
                          &lt;directory&gt;src/test/resources-glassfish-embedded&lt;/directory&gt;
                      &lt;/testResource&gt;
                  &lt;/testResources&gt;
                  &lt;plugins&gt;
                      &lt;!-- The surefire plugin is configured to pass a system property to GlassFish to retarget the derby log file --&gt;
                      &lt;plugin&gt;
                          &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                          &lt;version&gt;2.12&lt;/version&gt;
                          &lt;configuration&gt;
                              &lt;systemPropertyVariables&gt;
                                  &lt;java.util.logging.config.file&gt;
                                      ${project.build.testOutputDirectory}/logging.properties
                                  &lt;/java.util.logging.config.file&gt;
                                  &lt;derby.stream.error.file&gt;
                                      ${project.build.directory}/derby.log
                                  &lt;/derby.stream.error.file&gt;
                              &lt;/systemPropertyVariables&gt;
                              &lt;skipTests&gt;true&lt;/skipTests&gt;
                          &lt;/configuration&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/build&gt;
              &lt;!--
              &lt;repositories&gt;
                  &lt;repository&gt;
                      &lt;id&gt;arquiilian-repo&lt;/id&gt;
                      &lt;name&gt;Arquillian repositor&lt;/name&gt;
                      &lt;url&gt;http://repository.jboss.org/nexus/content/groups/public &lt;/url&gt;
                  &lt;/repository&gt;
              &lt;/repositories&gt;
              --&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  &lt;/project&gt;
  </code></pre>