title: How to achieve AspectJ compile time weaving using Spring BOOT and Gradle in an multi module project(weaving all modules)?
body: <p>I want to configure Spring BOOT to use AspectJ's compile time weaving.
  The base problem that I face is annotations like @Transactional, @Cacheable are ignored if the annotation function is called from within the same object. I know self autowiring is a fix, but that seems to be a design workaround for me and I am not satisfied with it.</p>
  
  <p>I have tried a gradle plugin from io.freefair(io.freefair.aspectj.post-compile-weaving).
  Again I have configured Spring boot to use AspectJ by annotating springBootMain by @EnableCaching(mode=AdviceMode.ASPECTJ).</p>
  
  <p>Kindly provide me further steps to configure properly. How should I tell aspect to weave this modules or packages? How to tell Spring AOP to not weave already weaved classes?</p>
  
  <p>I am adding my build.gradle.</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
          jcenter()
          maven {
              url "https://plugins.gradle.org/m2/"
          }
      }
      dependencies {
          classpath "io.freefair.gradle:aspectj-plugin:3.8.0"
      }
  }
  
  
  allprojects {
      group 'com.XYZ.PQR'
      version '1.0-SNAPSHOT'
  }
  
  subprojects {
  
  
      repositories {
          mavenCentral()
          jcenter()
      }
      apply plugin: 'java'
      apply plugin: 'idea'
  
      apply plugin: 'io.freefair.aspectj.post-compile-weaving'
  
  
      dependencies {
          compileOnly 'org.projectlombok:lombok:1.18.6'
          annotationProcessor 'org.projectlombok:lombok:1.18.6'
  
          implementation 'org.springframework.boot:spring-boot-starter-web'
  
  
          compile group: 'org.springframework', name: 'spring-aspects', version: '5.1.8.RELEASE'
  
          compile group: 'org.aspectj', name: 'aspectjweaver', version: '1.9.4'
  
          compile group: 'org.aspectj', name: 'aspectjrt', version: '1.9.4'
  
          testImplementation 'org.springframework.boot:spring-boot-starter-test'
  
          compile localGroovy()
  
      }
  }
  </code></pre>
  
  <p>Spring BOOT Main</p>
  
  <pre><code>@SpringBootApplication
  @EnableCaching(mode = AdviceMode.ASPECTJ)
  public class DemoApplication {
    public static void main(String[] args) {
      SpringApplication.run(DemoApplication.class, args);
    }
  }
  </code></pre>
  
  <p>Annotations like @Transactional and @Cacheable are getting igonred if the annotated function is called within the same class.
  I will like to these annotations to work within same class without self autowiring.</p>