使用 Spring 方面进行编译时代码检测的 Ant 目标 [英] Ant target for compile-time code instrumentation with Spring aspects

查看:28
本文介绍了使用 Spring 方面进行编译时代码检测的 Ant 目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Netbeans 6.7 和 Ant 开发了一个 Web 应用程序.webapp 可以工作,但我想重构代码以使用 @Configurable Spring 注释来进行更清晰的依赖注入.

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.

我能够让 Spring 方面的加载时编织 (LTW) 间歇性地工作(参见 http://forum.springsource.org/showthread.php?t=86904).

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.

谁能提供一个 Ant 目标,我可以在编译时使用它来编织 Spring 方面?

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

解释了如何配置 Netbeans 以在代码编译后立即执行新的 Ant 目标的任何人都将获得额外的荣誉.

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

谢谢.

推荐答案

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

有关完整示例,请参阅 AspectJ 开发指南 iajc 示例.

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

这篇关于使用 Spring 方面进行编译时代码检测的 Ant 目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆