title: Cannot run AspectJ CTW application in IntelliJ IDEA without Maven rebuild
body: <p><strong>EDIT/UPDATE: Delegate IDE build/run actions to maven in IntelliJ settings solve the problem, but how to handle it without it?</strong></p>
  <p>I have the following problem:</p>
  <p>I change something in my GetSthAspect class -&gt; Then I run maven clean install  (let's assume I have to always do clean install in my app) -&gt; Run spring app -&gt; And I see error:</p>
  <pre class="lang-none prettyprint-override"><code>java.lang.NoSuchMethodError: com.example.demo.aspects.GetSthAspect.aspectOf()Lcom/example/demo/aspects/GetSthAspect;
      at com.example.demo.aspects.A.shouldDoSthAndCallMethodGetSth(A.java:15) ~[classes/:na]
      at com.example.demo.aspects.AspectApp.main(AspectApp.java:18) ~[classes/:na]
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
      at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
      at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.10.jar:5.3.10]
      at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.10.jar:5.3.10]
    ...
  </code></pre>
  <p>Then I stop app -&gt; Again do maven clean install -&gt; Again run app and now everything works fine.</p>
  <p>It's always like that when I change something in my GetSthAspect class and I want to see my changes in app. Why is that? Why I have to build app -&gt; run app -&gt; stop app -&gt; again build app and run it in order to my aspects works fine? What should I do to avoid this situation?</p>
  <p><strong>GetSthAspect</strong></p>
  <pre class="lang-java prettyprint-override"><code>@Aspect
  public class GetSthAspect {
  
      Logger logger = LoggerFactory.getLogger(GetSthAspect.class);
  
      @Around(&quot;call(* Ent.getSth())&quot;)
      public Object around(ProceedingJoinPoint  pjp) throws Throwable {
          logger.info(&quot;Inside around + 12:52&quot;);
  
          Ent ent = (Ent) pjp.getTarget();
          logger.info(&quot;Number: &quot; + ent.getImportantNumber());
  
          return pjp.proceed();
      }
  }
  </code></pre>
  <p><strong>some class</strong></p>
  <pre class="lang-java prettyprint-override"><code>public class AspectApp {
  
      Logger logger = LoggerFactory.getLogger(AspectApp.class);
  
      @GetMapping(&quot;/&quot;)
      public String main() {
          logger.info(&quot;Method main started + 11:01&quot;);
  
          A a = new A();
          a.shouldDoSthAndCallMethodGetSth(1);
      }
  
  }
  </code></pre>
  <p><strong>A</strong></p>
  <pre class="lang-java prettyprint-override"><code>public class A {
  
      Logger logger = LoggerFactory.getLogger(A.class);
  
      public void shouldDoSthAndCallMethodGetSth(Integer a) {
          // ...
          Ent ent = new Ent();
          ent.setImportantNumber(1);
          logger.info(&quot;Method A do sth and ...&quot;);
          ent.getSth();
      }
  }
  </code></pre>
  <p><strong>pom.xml</strong></p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.5.5&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
      &lt;groupId&gt;com.example&lt;/groupId&gt;
      &lt;artifactId&gt;demo&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;Testing&lt;/name&gt;
      &lt;description&gt;App for tests&lt;/description&gt;
      &lt;properties&gt;
          &lt;java.version&gt;11&lt;/java.version&gt;
      &lt;/properties&gt;
      &lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-aop&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-rest&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.h2database&lt;/groupId&gt;
              &lt;artifactId&gt;h2&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
              &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt;
              &lt;version&gt;1.9.7&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
              &lt;artifactId&gt;aspectjweaver&lt;/artifactId&gt;
              &lt;version&gt;1.9.7&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &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.14.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;complianceLevel&gt;11&lt;/complianceLevel&gt;
                      &lt;source&gt;11&lt;/source&gt;
                      &lt;target&gt;11&lt;/target&gt;
                      &lt;showWeaveInfo&gt;true&lt;/showWeaveInfo&gt;
                      &lt;verbose&gt;true&lt;/verbose&gt;
                      &lt;Xlint&gt;ignore&lt;/Xlint&gt;
                      &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                  &lt;/configuration&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;!-- use this goal to weave all your main classes --&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>