为什么jcabi-aspects注释不起作用

问题描述

我有代码

public static void main(String[] args)
{
    testAnnotation();
}

@RetryOnFailure(attempts = 2)
public static void testAnnotation() {
    System.out.println("enter here");
    int x = 1/0;
}

但是它只运行一次函数。这是输出

enter here
Exception in thread "main" java.lang.ArithmeticException: / by zero
at Main.testAnnotation(Main.java:16)
at Main.main(Main.java:10)

这是我的pom:

<dependency>
        <groupId>com.jcabi</groupId>
        <artifactId>jcabi-aspects</artifactId>
        <version>0.22.6</version>
    </dependency>
    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>1.9.2</version>
        <scope>runtime</scope>
    </dependency>

加上插件

       <plugin>
            <groupId>com.jcabi</groupId>
            <artifactId>jcabi-maven-plugin</artifactId>
            <version>0.14.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>ajc</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjtools</artifactId>
                    <version>1.9.2</version>
                </dependency>
                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjweaver</artifactId>
                    <version>1.9.2</version>
                </dependency>
            </dependencies>
        </plugin>

我的程序不仅重试,而且无法识别任何注释。如何使其识别注释?谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)