简体   繁体   English

多Maven项目的Spring AOP问题

[英]Spring AOP issue with multi maven project

Hi I am using a multi maven spring project with modules in POM 嗨,我在POM中使用带有模块的Multi Maven Spring项目

  1. Bhoomi-domain-it Bhoomi-domain-it
  2. Bhoomi-data-it Bhoomi-data-it
  3. Bhoomi-domain 博米域
  4. Bhoomi-data 布米数据
  5. Bhoomi-presentation 布米演示
  6. Bhoomi-integration-consumer Bhoomi整合消费者
  7. Bhoomi-integration-provider Bhoomi集成提供者

With individual pom.xml 与单独的pom.xml

I have created a LoggerAspect Class in Bhoomi-presentation module containing 我在包含以下内容的Bhoomi-presentation模块中创建了LoggerAspect类

@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 问题是当我正在构建项目(Bhoomi-presentation-0.1.0.BUILD-SNAPSHOT.war)时,它仅记录存在于Bhoomi-presentation模块中的类文件的日志,而不会记录其他模块

All other module present as a jar in lib of WAR 所有其他模块在WAR库中以jar形式存在

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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