如何添加 tx:annotation-driven 到 grails

How to add tx:annotation-driven to grails

我正在尝试在 grails 2.4.3 项目中启用 aspectJ。互联网上的资源通常解释 spring。

他们建议添加

<tx:annotation-driven mode="aspectj"/>

我们如何将其添加到 grails 项目中?

<tx:annotation-driven mode="aspectj"/> 的等价物在 grails-app/conf/spring/resources.groovy 中是这样的:

xmlns tx:"http://www.springframework.org/schema/tx"
tx.'annotation-driven'(mode:'aspectj')