问题
Why was the attribute mode removed from Spring 3.1 task xsd? It's there in 3.0 version, and also the code in Spring 3.1 classes still check for the attribute and activate AspectJ mode is found.
回答1:
Interesting! Could be just a bug - the reason I am speculating this to be a bug is because it is still possible to select the mode via @Configuration using @EnableAsync(mode=AdviceMode.ASPECTJ)
This answers a part of your question, about why the check for mode is still there in the code - because it is possible through @Configuration.
回答2:
It was a bug. Fixed in 3.1.4/3.2.1. Use spring-task-3.0.xsd or spring-task-3.2.xsd as workaround.
来源:https://stackoverflow.com/questions/10357249/taskannotation-driven-mode-aspectj-no-longer-possible-in-spring-3-1