title: autoweaving AspectJ fails during unit tests in IntelliJ
body: <p>We have a series of unit tests and they were passing fine prior to me trying to add some aspects for dependency injection and logging duration of methods being called in our rest end points.  </p>
  
  <p>In the unit tests prior to the tests failing, we get two odd errors: </p>
  
  <pre><code>[AppClassLoader@14dad5dc] error aspect 'com.lutherconsulting.aphirm.log.DurationLoggingAspect' woven into 'com.lutherconsulting.aphirm.rest.ClientRest' must be defined to the weaver (placed on the aspectpath, or defined in an aop.xml file if using LTW).
  </code></pre>
  
  <p>and </p>
  
  <pre><code>[AppClassLoader@14dad5dc] error aspect 'com.lutherconsulting.aphirm.log.DurationLoggingAspect' woven into 'com.lutherconsulting.aphirm.log.DurationLoggingAspect' must be defined to the weaver (placed on the aspectpath, or defined in an aop.xml file if using LTW).
  </code></pre>
  
  <p>We are using the aspectj maven plugin to just let it autoweave the aspects into the web application.  The configuration for that from our pom.xml for Maven is below.  </p>
  
  <pre><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.8&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;showWeaveInfo&gt;true&lt;/showWeaveInfo&gt;
                  &lt;complianceLevel&gt;1.8&lt;/complianceLevel&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
                  &lt;Xlint&gt;ignore&lt;/Xlint&gt;
                  &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                  &lt;verbose&gt;true&lt;/verbose&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;test-compile&lt;/goal&gt;
                          &lt;goal&gt;compile&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>The strange thing is that this all works perfectly fine if I build the war file and deploy it to a Tomcat instance, or if I run all of our cucumber feature tests.  When I do either of those, The aspect weaves fine and I get data on the duration of the rest methods I annotated logged to a database correctly.  If I run a specific test package from intelliJ or try to run all junit tests in intellij, it fails with those two errors</p>
  
  <p>Is this something I'm just missing in Intellij as a run/debug configuration in the way it executes unit tests?  I didn't think our structure of our app was different than any normal web app</p>
  
  <pre><code>- src
     | - main
        | - java
           | - packages
        | - resources
     | - test
        | - java
           | - packages
        | - resources
  - pom.xml
  </code></pre>
  
  <p>I appreciate any ideas on </p>