title: Maven compile gives: Cannot find symbol - For a class sitting in the same app
body: <p>It's a while since I met such puzzling issue. I'm having a class that references another one sitting in another package in the same application, that is, NOT in another jar archive file. </p>
  
  <p>The including class is 
  learnintouch-rest/src/test/java/com/thalasoft/learnintouch/rest/acceptance/AbstractControllerTest.java</p>
  
  <p>The included class is
  /home/stephane/dev/java/projects/learnintouch-rest/src/test/java/com/thalasoft/learnintouch/rest/config/WebTestConfiguration.java</p>
  
  <p>Under Eclipse there is no issue and no compilation error in the editor.</p>
  
  <p>But running a Maven build gives a compilation error:</p>
  
  <pre><code>mvn clean test-compile -Pacceptance
  
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project learnintouch-rest: Compilation failure: Compilation failure:
  [ERROR] /home/stephane/dev/java/projects/learnintouch-rest/src/test/java/com/thalasoft/learnintouch/rest/acceptance/AbstractControllerTest.java:[16,46] cannot find symbol
  [ERROR] symbol:   class WebTestConfiguration
  [ERROR] location: package com.thalasoft.learnintouch.rest.config
  [ERROR] /home/stephane/dev/java/projects/learnintouch-rest/src/test/java/com/thalasoft/learnintouch/rest/acceptance/AbstractControllerTest.java:[21,116] cannot find symbol
  [ERROR] symbol: class WebTestConfiguration
  </code></pre>
  
  <p>Here is the code of the including class:</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @Transactional
  @WebAppConfiguration
  @ContextConfiguration(classes = {
      ApplicationConfiguration.class,
      WebSecurityConfig.class,
      WebConfiguration.class,
      WebTestConfiguration.class
  })
  public abstract class AbstractControllerTest {
  </code></pre>
  
  <p>This abstract test class is sitting under the acceptance test directory, which mandates the explicit activation of the -Pacceptance profile when running the Maven command.</p>
  
  <p>The default profile does not run this acceptance test, but only some integration test.</p>
  
  <p>One thing to note, is that this abstract class looks like the one abstract class used in the integration test.</p>
  
  <p>Here is the including class of the integration test:</p>
  
  <pre><code>import com.thalasoft.learnintouch.rest.config.WebTestConfiguration;
  
  @RunWith(SpringJUnit4ClassRunner.class)
  @WebAppConfiguration
  @ContextConfiguration(classes = {ApplicationConfiguration.class},
          WebSecurityConfig.class,
          WebConfiguration.class,
          WebTestConfiguration.class
          })
  @Transactional
  
  public abstract class AbstractControllerTest {
  </code></pre>
  
  <p>As you can see, it looks much like the other one.</p>
  
  <p>I can also give the <strong>pom.xml</strong> file content, if it can help:</p>
  
  <pre><code>&lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;rest&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;test.source.dir&gt;src/test/java/com/thalasoft/learnintouch/rest&lt;/test.source.dir&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;acceptance&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;test.source.dir&gt;src/test/java/com/thalasoft/learnintouch/rest/acceptance&lt;/test.source.dir&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>If you have any clue on this one, it'd be greatly appreciated.</p>