在使用Ant构建时,AspectJ不编织JUnit类

时间:2013-11-29 19:17:21

标签: java ant aspectj

我已经使用AspectJ创建了一个方面,构建它并在编译期间用它编织我的类我使用ANT任务。我还创建了测试类,用于测试该方面的工作方式。这是问题所在:我的测试类没有被编织。我不知道为什么 我的源文件夹是src / main / java,我的test文件夹是src / test / java 当我将我的测试类移动到源文件夹时,一切正常..

更新1:我没有将AspectJ与Spring结合使用。另外我没有使用aop.xml,我的方面正在注释。

更新2:我的ant compile-aspectj-tests目标如下所示:

<target name="compile-aspectj-tests" depends="compile">
        <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
            <classpath>
                <pathelement location="${ivy.install.dir}/../cache/org.aspectj/aspectjtools/jars/aspectjtools-1.7.3.jar" />
            </classpath> 
        </taskdef> 
        <iajc srcDir="${test.dir}/java" destDir="${compiled.tests}" debug="on" Xlintwarnings="true" 
            showWeaveInfo="true" source="${targetVersion}" target="${targetVersion}" >
            <classpath>
                <path refid="test.classpath" />
                <pathelement location="${compiled.src}" />
            </classpath>
            <aspectpath location="${compiled.src}" />
        </iajc>
    </target> 

这是我在控制台中看到的:

compile-aspectj-tests:
     [iajc] warning at com/.../cache/aspects/RetryJedisConnectionExceptionAspect.java::0 no match for this type name: RetryJedisConnectionException [Xlint:invalidAbsoluteTypeName]

任何帮助将不胜感激。

0 个答案:

没有答案
相关问题