1

一切都会编译,但会显示以下警告:

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]

有人可以解释他们的确切含义吗?

4

1 回答 1

4

这是您的编译时 AspectJ 编织过程的输出 - 它向您显示哪些 AspectJ 建议尚未应用到您的代码库中。

为了进一步扩展这一点 - Spring 相关方面通常META-INF/aop.xml在 spring-aspects.jar 文件中的文件中定义,如果某些切入点不匹配,这些方面会根据代码库中匹配的切入点编织到您的类中向上,例如,您可能在任何地方都没有任何@Async注释,那么建议不会被应用,您会看到以下消息advice defined in org.springframework.scheduling.aspectj.AbstractAsyncExecutionAspect has not been applied

于 2012-08-07T14:33:30.427 回答