title: How to add test-jar as aspectLibrary in Maven
body: <p>I have an aspect that I want to use in my test-classes. I don't want to add it to the main jar, as it would pull in test libraries like junit and mockito. While there's a configuration setting to add an aspectLibrary, it always adds the main jar, there's no way to specify the test-jar.</p>
  
  <p>My aspectj plugin looks like this:</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.7&lt;/version&gt;
      &lt;configuration&gt;
          &lt;aspectLibraries&gt;
          &lt;aspectLibrary&gt;
              &lt;groupId&gt;aspect.test&lt;/groupId&gt;
              &lt;artifactId&gt;general&lt;/artifactId&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/aspectLibrary&gt;
          &lt;/aspectLibraries&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
          &lt;execution&gt;
          &lt;phase&gt;process-sources&lt;/phase&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;/plugin&gt;
  </code></pre>
  
  <p>I actually want to specify test-jar but that doesn't seem possible. Without the  it defaults to the jar (obviously).</p>
  
  <p>I also might have to configure aspectj-maven-plugin for the compile and test-compile goal... but first I need to know how to specify the test-jar. Any suggestions are welcome.</p>