title: Maven + AspectJ - all steps to configure it
body: <p>I have a problem with applying aspects to my maven project. Probably I am missing something, so I've made a list of steps. Could you please check if it is correct?  </p>
  
  <p>Let say in <code>projectA</code> is an aspect class and in <code>projectB</code> classes, which should be changed by aspects. </p>
  
  <ul>
  <li>Create maven project <code>ProjectA</code> with <code>AspectJ</code> class </li>
  <li>add <code>Aspectj</code> plugin and dependency</li>
  <li>Add <code>ProjectA</code> as a dependency to <code>projectB</code> <code>pom.xml</code></li>
  <li>Add to <code>projectB</code> <code>pom.xml</code> plugin</li>
  </ul>
  
  <pre class="lang-xml prettyprint-override"><code>&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.4&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;goals&gt;
                  &lt;goal&gt;compile&lt;/goal&gt;
                  &lt;goal&gt;test-compile&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
      &lt;configuration&gt;
          &lt;source&gt;${maven.compiler.source}&lt;/source&gt;
          &lt;target&gt;${maven.compiler.target}&lt;/target&gt;
          &lt;aspectLibraries&gt;
              &lt;aspectLibrary&gt;
                  &lt;groupId&gt;ProjectA&lt;/groupId&gt;
                  &lt;artifactId&gt;ProjectA&lt;/artifactId&gt;
              &lt;/aspectLibrary&gt;
          &lt;/aspectLibraries&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <ul>
  <li>Add aspectj dependency</li>
  </ul>
  
  <p>After all these steps my problem is, that during compilation I get:</p>
  
  <pre><code>[WARNING] advice defined in AspectE has not been applied [Xlint:adviceDidNotMatch]
  </code></pre>
  
  <p>And then when I run my program:</p>
  
  <pre><code>Exception in thread "FeatureExcutionThread" java.lang.NoClassDefFoundError: AspectE
  </code></pre>