title: Adding AspectJ to pom.xml changed Java version with Maven, why?
body: <p><strong>UPDATE:</strong> here is my maven-compiler-plugin configuration:</p>
  
  <pre><code>&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;
  </code></pre>
  
  <p></p>
  
  <p>I work on a multi-project application that I build with Maven. We decided to add AspectJ so I added the following code to <code>pom.xml</code> in the top level project: (from the official documentation)</p>
  
  
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project&gt;
    ...
    &lt;dependencies&gt;
      ...
      &lt;dependency&gt;
        &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
        &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt;
        &lt;version&gt;1.7.3&lt;/version&gt;
      &lt;/dependency&gt;
      ...
    &lt;/dependencies&gt;
    ...
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
          &lt;artifactId&gt;aspectj-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.5&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;goals&gt;
                &lt;goal&gt;compile&lt;/goal&gt;    &lt;!-- use this goal to weave all your main classes --&gt;
                &lt;goal&gt;test-compile&lt;/goal&gt; &lt;!-- use this goal to weave all your test classes --&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
        ...
      &lt;/plugins&gt;
    &lt;build&gt;
    ...
  &lt;/project&gt;
  </code></pre>
  
  <p>and the following fragments to each subordinate projects:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;/project&gt;
        ...  
        &lt;build&gt;
          ....
             &lt;plugins&gt;
                 ...
              &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;aspectj-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
           &lt;/plugins&gt;
      &lt;/build&gt;
  
          &lt;dependencies&gt;
            ...
           &lt;dependency&gt;
          &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
          &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt;
           &lt;/dependency&gt;
           ....
        &lt;/dependencies&gt;
       ...  
   &lt;/project&gt;
  </code></pre>
  
  <p>Somehow this modification has overridden the Java version I use. If I run build I get multiple errors like this:</p>
  
  <blockquote>
    <p>Syntax error, annotations are only available if source level is 1.5 or greater</p>
  </blockquote>
  
  <p>That gives me the suspicion that my Java version (originally 1.6) was somehow reverted to 1.4. I did nothing - at least not knowingly - that could influence the Java version, so I suspect that the above mentioned AspectJ related code is responsible for the change.</p>
  
  <p>My question is how can AspectJ change the Java version and what should I do to fix this problem. Or do I misunderstand something completely and am I on the wrong track?</p>