Java 为什么jcabi方面注释没有';行不通
我有以下代码:Java 为什么jcabi方面注释没有';行不通,java,annotations,aspect,jcabi,Java,Annotations,Aspect,Jcabi,我有以下代码: 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
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>
com.jcabi
jcabi方面
0.22.6
org.aspectj
aspectjrt
1.9.2
运行时
加上这个插件:
<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>
com.jcabi
jcabi-maven插件
0.14.1
ajc
org.aspectj
aspectjtools
1.9.2
org.aspectj
aspectjweaver
1.9.2
我的程序不识别任何注释,不仅仅是重试。如何使其识别注释?多谢各位