title: Intercepting aspect for custom annotion
body: <p>I am writing a library/sdk which can intercept any methods which are annotated with a custom annotation <code>@Monitor</code>.
  The code works somewhat like this</p>
  
  <pre><code>@Monitor
  public void methodA(String test)
  </code></pre>
  
  <p>And the aspect which intercepts this has this pointcut expression</p>
  
  <pre><code>@After("execution(@com.packageA.Monitor * *(..))")
  public void intercept(final JoinPoint joinPoint){
  ...}
  </code></pre>
  
  <p>This code works fine when I describe the aspect in the same package as the <code>methodA</code>. However if I create a separate library and define the aspect in that its not able to intercept the <code>methodA</code> . Any help?</p>
  
  <h2>EDIT</h2>
  
  <p>In response to @Bond's comment</p>
  
  <pre><code>@Component
  @Target(value = {ElementType.METHOD, ElementType.TYPE})
  @Retention(value = RetentionPolicy.RUNTIME)
  public @interface Monitor {
  
  }
  </code></pre>
  
  <p>Spring versions:
  spring-context - 4.1.7.Release
  aspectj - 1.6.5
  The crux of the problem is that the annotation wont be used in the same project. After compilation it will be used in a different project all together.</p>
  
  <h2>EDIT2</h2>
  
  <p>The 2nd project i.e the one from which this aspect should be intercepting is compiled using aspectj maven plugin</p>