Ant target for compile-time code instrumentation with Spring aspects

和自甴很熟 提交于 2019-12-02 04:09:29

问题


I have developed a web application using Netbeans 6.7 and Ant. The webapp works, but I would like to refactor the code to use @Configurable Spring annotation for cleaner dependency injection.

I was able to get load-time weaving (LTW) of Spring aspects to work intermittently (see http://forum.springsource.org/showthread.php?t=86904).

At this point I would like to use compile-time weaving with my tool set.

Could anybody provide an Ant target that I can use to weave Spring aspects at compile time?

An extra credit will be given to anybody who explains how to configure Netbeans to execute the new Ant target right after code compilation.

Thanks.


回答1:


<iajc outjar="demo.jar">
    <sourceroots>
        <pathelement location=”src” />
        <pathelement location=".." />
    </sourceroots>
    <aspectpath>
        <pathelement location="org.springframework.aspects-3.0.0.RC1.jar" />
    </aspectpath>
</iajc>

For a full example, see the AspectJ development guide iajc sample.



来源:https://stackoverflow.com/questions/2539183/ant-target-for-compile-time-code-instrumentation-with-spring-aspects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!