title: Junit fails due to Aspect
body: <p>I have a custom security framwork based on annotations.I use the aspectj maven plugin to weave the aspect when it comes across the security annotation for the method.</p>
  
  <p>I use jenkins to build the project and the aspectj maven plugin goals are set for compile as given 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.4&lt;/version&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.6.5&lt;/version&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
                      &lt;artifactId&gt;aspectjtools&lt;/artifactId&gt;
                      &lt;version&gt;1.6.5&lt;/version&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
              &lt;configuration&gt;
                  &lt;showWeaveInfo&gt;true&lt;/showWeaveInfo&gt;
                  &lt;complianceLevel&gt;1.6&lt;/complianceLevel&gt;
                  &lt;!-- &lt;weaveDirectories&gt; &lt;weaveDirectory&gt;${project.build.directory}/classes&lt;/weaveDirectory&gt; 
                      &lt;/weaveDirectories&gt; --&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;!-- Compile and weave aspects after all classes compiled by javac --&gt;
                      &lt;phase&gt;process-classes&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;compile&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>The problem comes when the junit runs.Since it had already weaved the security related annotations in the methods,the unit test fails.</p>
  
  <p>Is there a way where I can have the junits work and then do the aspectj weaving?
  Since I use a .aj file separately I am not sure how load time weaving can be set.</p>
  
  <p>Any help on this is appreciated.</p>
  
  <p>Regards</p>