简体   繁体   中英

Spring AOP issue with multi maven project

Hi I am using a multi maven spring project with modules in POM

  1. Bhoomi-domain-it
  2. Bhoomi-data-it
  3. Bhoomi-domain
  4. Bhoomi-data
  5. Bhoomi-presentation
  6. Bhoomi-integration-consumer
  7. Bhoomi-integration-provider

With individual pom.xml

I have created a LoggerAspect Class in Bhoomi-presentation module containing

@Pointcut("execution(* *.*(..))")

Question is when i am building project(Bhoomi-presentation-0.1.0.BUILD-SNAPSHOT.war) it is only logging logs of class files present in Bhoomi-presentation module not for other module

All other module present as a jar in lib of WAR

Please let me know if i forgot any configuration so that i can log all project logs

I can think of something like this in XML( surely it can be done with annotations as well ) for creating common pointcuts spanning multiple modules

<aop:config>
        <aop:pointcut id="appPointcutServices" expression="bean(*Services)" />
        <aop:pointcut id="appPointcutDao" expression="bean(*Dao)" />
        <aop:pointcut id="appPointcutRepository" expression="bean(*Repository)" />
<aop:config>

& Then attach these pointcuts with your application defined Advisor

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM