所有内容都会编译,但会显示以下警告:
Warning: advice defined in org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMatch]
Warning: advice defined in org.springframework.mock.staticmock.AbstractMethodMockingControl has not been applied [Xlint:adviceDidNotMatch]
Warning: advice defined in org.springframework.scheduling.aspectj.AbstractAsyncExecutionAspect has not been applied [Xlint:adviceDidNotMatch]
Warning: advice defined in org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect has not been applied [Xlint:adviceDidNotMatch]
有人可以解释它们究竟是什么意思吗?
答案 0 :(得分:4)
这是编译时AspectJ编织过程的输出 - 它显示了您的代码库中尚未应用哪些AspectJ建议。
为了进一步扩展这一点 - Spring相关方面通常在spring-aspects.jar文件中的META-INF/aop.xml
文件中定义,并且这些方面根据您的匹配中的切入点编织到您的类中代码库,如果某些切入点不匹配,例如,您可能在任何地方都没有任何@Async
注释,那么建议不会被应用,您会看到advice defined in org.springframework.scheduling.aspectj.AbstractAsyncExecutionAspect has not been applied