2

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

John Powell
  • 12,253
  • 6
  • 59
  • 67
Prashant Shah
  • 108
  • 1
  • 7
  • is there a separate spring context in each module? you might need to enable aop in each? or if there is one then the root one. – MarianP Aug 05 '14 at 16:02
  • http://stackoverflow.com/questions/10204374/spring-aspect-not-executed-when-defined-in-other-jar – MarianP Aug 05 '14 at 16:03

1 Answers1

0
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
Puneetsri
  • 234
  • 2
  • 7